• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

servlet.jar and j2ee.jar

 
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
 
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.
 
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%
 
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.
 
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 ]
 
I want my playground back. Here, I'll give you this tiny ad for it:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic