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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

package javax.servlet does not exist

Status
Not open for further replies.

delereum

Programmer
Jan 2, 2004
5
US
i have had some serious problems setting this up to work properly. i have worked with my instructor and also throughout some books i bought on tomcat and cannot resolve this. i need to set this up to compile my servlets.

PLEASE NOTE THAT THIS IS NOT A HOMEWORK OR CLASS ASSIGNMENT

package javax.servlet does not exist
package javax.servlet.http does not exist


I have currently uninstalled and reinstalled using jsdk1.4.2_03 and tomcat-4.1.27. The CLASSPATH is set to include c:\jakarta-tomcat-4.1.27\common\lib\servlet.jar in addition to this i added the servlet.jar file to the PATH variable as well.

Tomcat is starting and running normally on and i am using the statement:

import javax.servlet.*;
impirt javax.servlet.http.*;

i have also tried compiling an apache example [included with the tomcat package] and it does not work when pasted into a new .java file.

however, the apache class files seem to run when using them in the browser whereas mine do not. but i cannot compile any of them. [i am going to cry]

System: Windows 2000 Professiona; SP3
Tomcat: Jakarta-Tomcat 4.1.27 [unzip]
JDK Files: J2SDK 1.4.2_03 [exe install]
 
OK, its bound to be something daft! The two packages you are importing (I take it the "impirt" is a typo) definitely are in the servlet.jar.

Check that the path/file "c:\jakarta-tomcat-4.1.27\common\lib\servlet.jar" defintely exists, and you are setting the CLASSPATH as so :

set CLASSPATH=%CLASSPATH%;C:\wheremyjarsare\servlet.jar

And also come back with the precise error message from the console.
 
Actually you were right it was a fluke, i am worried that it may happen again. i did actually get it to recognize a few times - i hope that it is okay now. the compile error was that package javax.servlet does not exist not really anything else. It would give the line number and everything... i was compiling within EditPlus2 through the applications console.

basically what i did was reset the classpath and the class information. i added them to the environment variables for system and user - making sure they were identical. and yes the import was a typo :). I then echo'd them in the command prompt and it did not show any of the changes i had made. i rebooted the system and then they checked again and the changes i had made were gone. i had to enter the path information again.

my assumption is that this is a permissions problem with Windows 2000, since it did eventually take. Have you seen anything like this before?

=============================================

I am now getting another path message for the oracle.jdbc.driver package for use with Oracle8i, do you know what the path is for this class?
 
We have experienced problems with W2K when setting vaiables such as CLASSPATH or whatever in the "user" section. Setting them in "System" usually works ... but not always.

For production systems, we always start our servers with explicit "set BLA=C:\bla" in the startup script ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top