Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please Help me

 
david hongw wang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24208
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classpath must contain the JARs themselves, not the directories in which the JARs are found.
 
david hongw wang
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Very Much! I got it:

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

not only E:\Tomcat\common\lib
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic