This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Please Help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Please Help me" Watch "Please Help me" New topic
Author

Please Help me

david hongw wang
Greenhorn

Joined: Mar 28, 2006
Posts: 6
when I am trying to compile a servlet:
----------------------------------
package javax.servlet does not exist
----------------------------------
I have set ClassPath:
-----------------------------------
.;E:\Sun\AppServer\jdk\lib;E:\Sun\AppServer;E:\Sun\AppServer\lib;
E:\Tomcat\server\lib;E:\Tomcat;E:\Tomcat\common\lib;E:\Tomcat\server\lib;E:\Tomcat\common\classes\netforge\lib;
E:\Tomcat\webapps\tsf;E:\Tomcat\webapps\tsf\WEB-INF\classes;E:\EDB\connectors\jdbc;E:\EDB\mgmtsvr\server\default\lib;e:\edb\jre1.5\lib;
--------------------------------------
I can find these jars in my computer:

1:
servlet-api.jar (96kb) in
E:\Tomcat\common\lib

2:
j2ee.jar in
E:\Sun\AppServer\lib

3:
tools.jar in
E:\Sun\AppServer\jdk\lib
-------------------------------------------

I really don't konw what's wrong! I have searched 2 days and tried 2 days, need help! thank you very much!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

The classpath must contain the JARs themselves, not the directories in which the JARs are found.


[Jess in Action][AskingGoodQuestions]
david hongw wang
Greenhorn

Joined: Mar 28, 2006
Posts: 6
sorry, I didn't understand yet. You mean I have to copy these jars to somewhere else?
Thank You Very Much for reply
david hongw wang
Greenhorn

Joined: Mar 28, 2006
Posts: 6
Thank You Very Much! I got it:

E:\Tomcat\common\lib\servlet-api.jar

not only E:\Tomcat\common\lib
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

This appears to be resolved, but I'm moving this to the Tomcat forum for other users who might have the same set-up question (and as a subtle hint that this would be a good place to ask future Tomcat questions ).
[ March 28, 2006: Message edited by: marc weber ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
I'm going to add my 2 cents worth. I know there is a learning curve, but it is reallly worth it to learn how to use ANT to compile etc. Tomcat projects. It frees you from messing around with the system environment CLASSPATH variable - that alone is worth the trouble.
Furthermore, all open source tools that work with Tomcat - such as AXIS - provide ANT build files to carry out common tasks.
Bill
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Please Help me