• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setup question

 
Charles Cayman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm beginning to study servlets and all those stuff... I have my jdk131 installed,
and my tomcat up and running...
However, when I try to compile my first servlets using javac, it does not
see where the servlet libraries are. After some searching and head-scratching,
I found a servlet.jar in one of Tomcat's subdirectory. I know this is related,
but I couldn't figure out what to do... I have been changing a lot like changing
the CLASSPATH, PATH, etc.; but nothing seems to do the trick.
How do I make this work?
Thanks a lot in advance!!!
[ July 02, 2002: Message edited by: Charles Cayman ]
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just put the servlet.jar in your global CLASSPATH
If you are using windows 98/ME - you should add e.g. C:\tomcat\lib\servlet.jar to the CLASSPATH in autoexec.bat, and restarted your PC?
If using windows NT/2000/XP - then you should add e.g. C:\tomcat\lib\servlet.jar to the CLASSPATH in your 'Environment Variables'.
You should now be able to type javac SomeServlet.java without any errors.
Sometimes it is a god idea to add a .(dot) to the CLASSPATH as well.
/Rene
 
Charles Cayman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, thanks for the reply.
I'm using Windows 2000 Pro. I went to the System Properties and looked at the Environment Variables, but only to find out that I don't have the privileges to edit them. I tried editing the CLASSPATH using a batch file. The CLASSPATH contains the new path, but it still does not work... Maybe, I need to edit the one in the System properties? I'll try to ask our administrator later or tomorrow to edit the environment variables...
Thanks!
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also just use the option -classpath when you compile the code.
e.g. javac -classpath .;C:\tomcat\lib\servlet.jar TestServlet.java
/Rene
[ July 03, 2002: Message edited by: Rene Larsen ]
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Put the servlet.jar file in your
jdk1.3\jre\lib\ext\ directory.
 
Charles Cayman
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks everybody... It's working now...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic