Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuring JDK for Servlets

 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand that the servlet API needs to be added to JDK so that I can compile servlets. I got a file called servlets.jar which i believe is the file i need. Where do I place it or how do I set the classpath? Currently I get 100 errors when I try to compile a servlet.
Please help fellow ranchers!
 
Kaju Singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well Ernest,
I believe, you just have to add the path of teh servlet.jar files in your "CLASSPATH".
Thanx
Kaju
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is where I have it. \jdk1.2.2\jre\lib\ext\servlet.jar

Bosun
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18164
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Placing a jar in a directory in your CLASSPATH doesn't add it to your CLASSPATH. CLASSPATH is and envirorment variable which points to jar files and class directories. You need to add the full pathname (including the ".jar" suffix) of your servlet jar to the classpath:
SET CLASSPATH=%CLASSPATH%;C:\jdk1.2.2\jre\lib\ext\servlet.jar
 
ernest fakudze
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help ranchers. Now the new problem: I don't know which file to edit in order to set my classpath. Could anybody please tell me how to set it in Windows 98 and Windows 2K. Thanks a lot in advance!!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jar files in the standard extensions directory are automatically located by the JVM before the classpath is searched. See the file named findingclasses.html in the tooldocs directory of your SDK installation. Therefore putting servlet.jar in that directory is sufficient.
The Tooldocs directory is where you will find advice on how to set up your classpath on various operating systems. Start at the tools.html file.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic