This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Problem with Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem with Servlet" Watch "Problem with Servlet" New topic
Author

Problem with Servlet

Sunita Vontel
Ranch Hand

Joined: Aug 28, 2000
Posts: 72
My autoexec file looks like this
PATH C:\JDK1.2.1\BIN;C:\JSDK2.0\BIN;C:\JSDK2.0\src
SET CLASSPATH = .;c:\jsdk2.0\lib\jsdk.jar;C:\JDK1.2.1\LIB;C:\JSDK2.0\src;c:\jsdk2.0\lib
I am trying to run a servlet and I am getting the error
Package javax.servlet not found in import
Package javax.servlet.http not found in import.
Can somebody please tell me how to set the path or classpath so that my program runs fine.
Thanks
Sunita
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12759
    
    5
I'm not using JSDK but!
remember that the servlet classes are "standard extensions" which belong in the
\JDK1.2\jre\lib\ext
directory. Java 1.2 does NOT have to have classpath set to find the standard extensions OR the standard library jar files.
See the tooldocs documentation.
Why are you using JSDK instead of Tomcat?
Bill
Sunita Vontel
Ranch Hand

Joined: Aug 28, 2000
Posts: 72
Thanks William
I did not know about Tomcat.
But I just tried
javac -classpath c:\jsdk2.0\lib\jsdk.jar file.java
and it worked.Probably my classpath is not set correctly.

Sunita
Sunita Vontel
Ranch Hand

Joined: Aug 28, 2000
Posts: 72
Thanks William
I did not know about Tomcat.
But I just tried
javac -classpath c:\jsdk2.0\lib\jsdk.jar file.java
and it worked.Probably my classpath is not set correctly.

Sunita
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with Servlet
 
Similar Threads
Pls make my Tomcat Running..
servlet compiling
Tomcat is not running.. pls help
Pls make my Tomcat Running..
Tomcat........