This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 Android Security Essentials Live Lessons this week in the Android 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: 12761
    
    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
 
jQuery in Action, 2nd edition
 
subject: Problem with Servlet
 
Similar Threads
Tomcat........
Pls make my Tomcat Running..
Pls make my Tomcat Running..
servlet compiling
Tomcat is not running.. pls help