aspose file tools*
The moose likes Servlets and the fly likes Configuring JDK for Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Configuring JDK for Servlets" Watch "Configuring JDK for Servlets" New topic
Author

Configuring JDK for Servlets

ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
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!


In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
Kaju Singh
Greenhorn

Joined: Jul 30, 2001
Posts: 10
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

Joined: Nov 06, 2000
Posts: 1510
This is where I have it. \jdk1.2.2\jre\lib\ext\servlet.jar

Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16228
    
  21

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


Customer surveys are for companies who didn't pay proper attention to begin with.
ernest fakudze
Ranch Hand

Joined: Aug 27, 2001
Posts: 216
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

Joined: Mar 22, 2000
Posts: 12821
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuring JDK for Servlets