Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in compiling HelloServlet.java  RSS feed

 
Gautam Sathe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have downloaded and installed Jakarta Tomcat 4.0 Beta 6. My Operating system is Windows 98 and I also have JDK1.3. I have made a change in CLASSPATH. Now my CLASSPATH variable looks like this:
CLASSPATH=.;C:\JDK1.3\lib\tools.jar
I have a servlet program, when I try compile it usig command "javac HelloServlet.java" I get 8 errors indicating it is unable to find javax.servlet.* classes.
How can I configure my Tomcat and JDK1.3 so as to compile the servlet program.
Is there any perticular way to compile and run the program.
Please help.
Gautam.
------------------
 
Swami nathan
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gautham,
You need to have the servlet class files in your classpath.
Copy servlet.jar from jakarta\lib and paste it under
jdk1.3\jre\lib\ext and compile your program again.
(i did this for tomcat3.2.2 i'm not sure whether or not it works for tomcat 4.0,guess should be same)
regds,
swaminathan.
 
Gautam Sathe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Swaninathan for you help.
My servlet program is now compiling.
Originally posted by Swami nathan:
Gautham,
You need to have the servlet class files in your classpath.
Copy servlet.jar from jakarta\lib and paste it under
jdk1.3\jre\lib\ext and compile your program again.
(i did this for tomcat3.2.2 i'm not sure whether or not it works for tomcat 4.0,guess should be same)
regds,
swaminathan.


------------------
 
saurabh pathak
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello gautam
to simply compile servlets servlet.jar is needed which contains required javax package files so if u r using tomcat web server so use its servlet.jar for compilation u find this in lib folder so write classpath:
tomcat\lib\servlet.jar
thanks
saurabh
 
Gautam Sathe
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Saurabh,
I have already changed my classpath in autoexec.bat, now it is
SET CLASSPATH=.;C:\JDK1.3\lib\tools.jar;C:\JAKART~1\common\lib\servlet.jar
But without copying the servlet.jar file to the c:\jdk1.3\jre\lib\ext directory the program is not compiling. Do you know the reason?
Anyway thanks for the help.
Gautam.
Originally posted by saurabh pathak:
hello gautam
to simply compile servlets servlet.jar is needed which contains required javax package files so if u r using tomcat web server so use its servlet.jar for compilation u find this in lib folder so write classpath:
tomcat\lib\servlet.jar
thanks
saurabh


------------------
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!