• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Problem in compiling HelloServlet.java

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
------------------
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.



------------------
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



------------------
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic