• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package javax.servlet does not exist

 
Stan Forest
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When trying to compile and the system is not finding the javax.servlet package. "package javax.servlet does not exist" is the error message. The location of the servlet-api.jar is set as part of the classpath: c:\Tomcat\common\lib\servlet-api.jar

Any suggestions?
 
Ravi Joshi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stan,

Did you set the classpath "c:\Tomcat\common\lib\servlet-api.jar" as
a part of environment variables or you are setting it while trying to
compile your java file.

I faced similar problem. Then, I set the classpath in environment variables.
 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
classpath is classpath it should not matter if you set it in env. variable or provide it at compile time.

I would suggest you try following things.

1. classpath setting at compile time.
Check the error provided by javac
check if .jar and other dependencies are really present in the specified path. there is possiblity of typo or the files might not be present at that location.

2. classpath as env. variable
In case you have already started the shell and then you set the classpath in evn. variable then current shell will not accomodate new changes.

Close existing shell and open new shell to get the variable change in use.

hope this works
 
Stan Forest
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help. I had the classpath set two places and it would not work. It will compile now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic