Re: package does not exist error

Discussion in 'Java' started by sufia, Jul 7, 2003.

  1. sufia

    sufia Guest

    I had the exact same problem too. The problem with mine was the
    CLASSPATH variable. Check to make sure that your path's right.
    good luck.


    (Mitch Ratisher) wrote in message news:<>...
    > With a jar or zip file, you have to explicitly include the file name
    > of the archive in the classpath. Otherwise, there is no way to know
    > which archive to look in. Either append the full path to servlet.jar
    > (or whatever file has the servlet classes) to CLASSPATH, or do
    > something like:
    > javac -classpath ".;d:\j2ee\lib\servlet.jar" SampleServer.java
    >
    >
    > "Netmasker" <> wrote in message news:<bcvrs0$2ba$>...
    > > I try to compile the file "SampleServer.java" which contains code for
    > > implementing a sample servlet. I use this command: "javac SampleServer.java"
    > > but I take the following errors (and others) because it can not find
    > > the necessary classes.
    > > -----------------------------------------------------------------------
    > > SampleServer.java:2:
    > > import javax.servlet.*; import javax.servlet.http.*;
    > > ^
    > > SampleServer.java:2: package javax.servlet.http does not exist
    > > import javax.servlet.*; import javax.servlet.http.*;
    > > ^
    > > -----------------------------------------------------------------------
    > > I suppose that is because I haven't done anything with the "CLASSPATH".
    > > I am using Windows 2000 Server and I have installed both "j2sdk1.4.1_02" and
    > > "j2sdkee1.4".
    > > But even if I run the above command from the directory "\j2sdkee1.4\lib"
    > > which contains the libraries (in the *.jar files) I take the same errors.
    > > Why this happens or what else could be wrong ????
    > >
    > > TIA
     
    sufia, Jul 7, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Laurent Leconte
    Replies:
    2
    Views:
    7,708
    Laurent Leconte
    Oct 14, 2003
  2. Nachiketh

    package does not exist error

    Nachiketh, Apr 17, 2004, in forum: Java
    Replies:
    1
    Views:
    15,075
    Roedy Green
    Apr 18, 2004
  3. LT
    Replies:
    7
    Views:
    2,147
    Phlip
    Jul 25, 2004
  4. Replies:
    4
    Views:
    13,354
    Simon Brooke
    Nov 11, 2006
  5. Replies:
    16
    Views:
    985
    Arne Vajhøj
    Feb 24, 2013
Loading...

Share This Page