• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting classpath help ???  RSS feed

 
Jean Paul Martin
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everyone,

I'm new to JSP and i just installed Tomcat and i get it to start fine. However, when i write my own java files and want to compile them using javac myfile.java its not recognizing my servlet imports: import java.servlet.http.* & java.serlet.*;

I am using Windows XP and I have added c:\jakarta-tomcat-3.3.2\lib\common\servlet.jar to my Environment Variables right after c:\j2sdk1.4.2_04\bin

Could anybody help me out? Thank you for your help.

Jean Paul
 
Ivan Tamayo
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two different environment variables:

PATH = Where are placed the javac and java program, besides others executables.

CLASSPATH = Where are the classes you need.

You should put the path of servlet-api.jar in the CLASSPATH
 
siva krishnan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The PATH to javac seems ok as it is throwing a compiler error. (It would have thrown UNKNOWN COMMAND if it could't find javac/java).
The errors you are getting are most likely because the CLASSPATH were not set properly.
Try this command before attempting to compile :
SET CLASSPATH=%CLASSPATH%;c:\jakarta-tomcat-3.3.2\lib\common\servlet.jar
Are you sure it is lib/common.
It appears as common/lib/servlet.jar in my version.
Anyways, please try compiling after running the above command.

Cheers
Siva
SCJP 1.4
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!