Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can't compile the servlet class???? 1

Status
Not open for further replies.

pdotd

Programmer
Jun 15, 2004
29
CA
Hey there

I have j2sdk1.4.2_04 and tomcat 5.0 installed, but when i try to compile a servlet, i can't because it says it can't the javax.servlet package(class)???
Now i have created the “JAVA_HOME” to the pathname of J2SDK directory

and “CATALINA_HOME” to the pathname of TOMCAT directory

but i still get the exception errors saying it can't find the servlet package.

if someone could please help me out so can compile my servlet class properly it would be greatly appreciated.

Thanks
 
How do you compile the class?

Make sure you have servlet.jar in your classpath!

Sjakie

----------
Yes, the world is full of strange people.
 
Note in tomcat 5, servlet.jar has been renamed to servlet-api.jar and is located in common/lib.

make sure your CLASSPATH includes the line :

%CATALINA_HOME%\common\lib\servlet-api.jar
 
so now after i set the class path, should i be able to go into my command prompt and type javac HelloServlet.java
and have the servlet compile now?
 
one way would be to "cd" to your directory where the servlet java file is, and then "javac *.java" ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top