Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Servlets
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Servlets section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 3rd, 2005, 07:32 PM
Registered User
Join Date: Mar 2005
Location: Torrance, CA, USA.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to compile servlet?

Hello everyone,

I want to compile simple servlet which shows on the browser hello world.
I have jdk1.5 and tomcat 4.1 on windowx XP
I have given classpath = C:\tomcat1.4\comman\lib\servlet.jar
and java_home = C:\jdk1.5
Please help me!!!
whenever I compile it throws pacakge javax.servlet.http does not exist.
Reply With Quote
  #2 (permalink)  
Old March 8th, 2005, 12:47 AM
Authorized User
Join Date: Mar 2005
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts

hi monali,
          i was facing similar problem earlier.i have given the class path in the environment variable itself.but i got the same error every times.i typed the classpath command in the command prompt every time.now its working.
set CLASSPATH=.;C:\Program Files\Apache Tomcat 4.0\common\lib\servlet.jar

i have inserted this line in my autoexec.bat file so i thought no need to set classpath everytime.
then i got the same error.
so whenever i want to execute a servlets or jsp program i will execute the command from the command prompt.



Reply With Quote
  #3 (permalink)  
Old March 22nd, 2006, 06:03 AM
Authorized User
Join Date: Mar 2006
Location: , , .
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts

Pls check whether servlet-api.jar or servlet.jar.

In case of Tomcat 5.0, servlet-api.jar is correct

Reply With Quote
  #4 (permalink)  
Old June 23rd, 2006, 08:41 AM
Authorized User
Join Date: Jun 2006
Location: BANGALORE, Karnatak, India.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ajit


Reply With Quote
  #5 (permalink)  
Old December 26th, 2006, 04:44 PM
Authorized User
Join Date: Dec 2005
Location: Mingora, NWFP, Pakistan.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to shahhussain Send a message via Yahoo to shahhussain

Hello I was facing the same problem in my first servlet but now i can run my servlet I am having the jdk1.5 with apache tomcat 4 with window xp sp2 and i have set the environment variables as :
-------------------for JAVA_HOME---------
variable Name = JAVA_HOME
variable value = C:\Program Files\Java\jdk1.5.0_09
---------------for CATALINE_HOME------
variable name = CATALINA_HOME
variable name = C:\Program Files\Apache Group\Tomcat 4.1
-------------FOR CLASSPATH-----------
variable name = CLASSPATH
variable value = C:\Program Files\Apache Group\Tomcat 4.1\common\lib\servlet-api.jar;C:\Program Files\Apache Group\Tomcat 4.1\common\lib\jsp-api.jar;.;
Note that I have pasted the jsp-api.jar and servlet-api.jar in my common lib directory from another version of apache tomcat.
also that the variables name and values are case sensitive
sorry my english is not good.
hope help you

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to compile a servlet program????? sushant2002 J2EE 4 December 24th, 2007 06:42 AM
how to compile servlet..... Random Servlets 1 January 16th, 2006 12:28 AM
Compile Louisa VB.NET 2002/2003 Basics 1 November 23rd, 2005 10:14 AM
C# compile biran Visual Studio 2005 1 July 15th, 2005 01:36 PM
How to compile a servlet? wujie J2EE 1 May 13th, 2004 12:12 PM

All times are GMT -4. The time now is 07:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.