#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    209
    Rep Power
    14

    Problems in compling Servlets


    Hi there i am having problems trying to compile servlets even those that are examples found in the tomcat directory. The jdk am using is able to compile any other type of classes but not that classes that require the packag javax.servlet infact when compiling it, it says it doesnt exist !.

    I am using tomcat 4.0 beta 7 and JDK ver 1.4 on a Windows 2000 machine. When typing http://127.0.0.1:8080/ the tomcat page appears and when attempting to run the ready made servlets evverything is normal however problem is compiling them.

    My server settings are as follows :-

    1) Windows 2000- Environment settings (System Variables)-

    CATALINA_HOME- C:\Program Files\Tomcat4.0

    JAVA_HOME - C:\jdk1.4

    CLASSPATH - C:\jdk1.4\bin\tools.jar;C:\Program Files\Tomcat4\lib\servlet.jar;%CLASSPATH%

    PATH - C:\jdk1.4\bin;C:\Program Files\Tomcat4

    2) Javac commands functions normally and the connection to the server from http://127.0.0.1:8080 works fine.

    3) Error obtained after attempting to compile :-

    HelloWorld.java:2: package javax.servlet does not exist
    import javax.servlet.*

    Therefore throughout the script every class within this package is regarded as an error.

    Can any one help solve this problem or help reconfigure the server ??

    Apperciate ur help !!

    Urban Developer
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2001
    Posts
    0
    Rep Power
    0

    Smile


    Umm I might be wrong here but did you make sure you downloaded the servlet packages from Sun's website?

    Look for java servlets under product and you'll find a link. Extract the jar file to your JDK directory and then add it to your classpath. Restart your computer and it should work.

    Let me know if it doesn't
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Singapore
    Posts
    3
    Rep Power
    0
    I might be wrong. To me it seems that your path does not cover the Tomcat4/lib/ . So it may not find servlet.jar.

IMN logo majestic logo threadwatch logo seochat tools logo