• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

servlet.jar and j2ee.jar

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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%
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I've never won anything before. Not even a tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic