Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

servlet.jar and j2ee.jar  RSS feed

 
Priyanka Chopda
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm having trouble compiling my servlet. I did set classpath pointing to servlet.jar and j2ee.jar like
set CLASSPATH=%CLASSPATH%;F:\Applications\Tomcat4.1\common\lib\servlet.jar;F:\Applications\Tomcat4.1\common\lib\j2ee.jar
But still i'm getting errors
package javax.servlet does not exist
package javax.servlet.http does not exist
import javax.servlet.http.*;
....
Just wondering what am I missing?
Thanks
-PC
 
Ken Robinson
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all depends on how you are compiling your code. If you are using an IDE (JBuilder, NetBeans), you will have to configure the project's classpath. If you are using ant, you will have to configure a classpath for ant.
Also, if you have any typos in your CLASSPATH definition, there may be problems finding the files in directories listed after the error.
 
lali virdi
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set CLASSPATH=%CLASSPATH%;F:\Applications\Tomcat4.1\common\lib\servlet.jar;F:\Applications\Tomcat4.1\common\lib\j2ee.jar
set CLASSPATH =.;F:\Applications\Tomcat4.1\common\lib\servlet.jar;F:\Applications\Tomcat4.1\common\lib\j2ee.jar;
%CLASSPATH%;

do this or check this -- %CLASSPATH%
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is j2ee.jar doing in Tomcat's common/lib directory?

It doesn't come with it, and you're asking for trouble by putting it there.
 
bharat nagpal
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
simplest way
create a new dir c:\lib
copy servlet.jar and j2ee.jar in this directory.
open command prompt and type.
SET CLASSPATH=%CLASSPATH%;.;c:\lib\servlet.jar;c:\lib\j2ee.jar
Now try to compile.
Later set the values in environmental variables.
[ February 10, 2004: Message edited by: bharat nagpal ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!