File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Where to put the servlet.jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Where to put the servlet.jar" Watch "Where to put the servlet.jar" New topic

Where to put the servlet.jar

Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
Hi, I just found a servlet.jar in tomcat's lib directory. I put it in C:\jdk1.2.1\lib, the compiler can not find javax.servlet.*. Then I put it in C:\jdk1.2.1\jre\lib, the compiler still can't find javax.servlet.*. Can someone tell me where exactly to place the servlet.jar?
BTW, I am using JDK 1.2.1.
Bipul Bhatta

Joined: Apr 07, 2001
Posts: 1
As u find the servlet.jar in the tomcat's directory, note down the full path.Then go to the dos prompt and set classpath ,the command may be set classpath=%classpath%;c:dir name\dir name\(where servlet.jar file is).

Then complie servlet file and run it.Think now it will work .
Cameron Park
Ranch Hand

Joined: Apr 06, 2001
Posts: 371
At c:/> I put classpath=%classpath%;C:\jakarta-tomcat-3.2.1\lib, but DOS says "Bad command or file name". Can you be more specific?
Desai Sandeep
Ranch Hand

Joined: Apr 02, 2001
Posts: 1157
Hi Cameron,
If JAR file has to be recognized in the classpath, you need to provide the complete path including the name of the JAR file
Assuming, that you have have servlet.jar in C:\jakarta-tomcat-3.2.1\lib, this is what you need to add in your System/User Classpath of your system

Alternatively, you could type the following command in the DOS-Prompt

Hope this helps,

Sandeep Desai

  1. Sun Certified Java Programmer Scored 93 per cent
  2. Oracle JDeveloper Rel. 3.0 - Develop Database Applications with Java Scored 56 out of 59
  3. IBM Enterprise Connectivity with J2EE Scored 72 per cent
  4. Enterprise Development on the Oracle Internet Platform Scored 44 out of 56
I agree. Here's the link:
subject: Where to put the servlet.jar
It's not a secret anymore!