DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Sami Guest

    Simple CLASSPATH problem for compilation of servlets in JWS2.0


    I have installed Java Web Server on win98.
    In order to compile any servlet, one has to set classpath as c:\JavaWebserver2.0\lib\servlet.jar

    If I set this variable in my autoexec.bat,like set CLASSPATH = c:\JavaWebServer2.0\lib\servlet.jar;%CLASSPATH%
    now If I try to compile the applet
    javac HelloWorld.java
    compiler gives me error - javax.servlet.*; &
    javax.servlet.http.*; not found
    but if on commmand line I type
    javac -classpath c:\JavaWebServer2.0\lib\servlet.jar HelloWorld.java
    then servlet will compile corectly and can be executed on server any idea
    what is wrong in setting classpath in autoexec.bat file
    Thanx in Advance
    Sami



  2. #2
    Paul Clapham Guest

    Re: Simple CLASSPATH problem for compilation of servlets in JWS2.0

    Do you have the spaces around the = in your autoexec.bat as well as here?
    Get rid of them, you're defining an environment variable called
    CLASSPATH<space> instead of CLASSPATH. And if you want to know what
    environment variables are set, just type "SET" at the command line.

    PC2

    Sami <sa@infobroker.com.au> wrote in message
    news:3a81f47f$1@news.devx.com...
    >
    > I have installed Java Web Server on win98.
    > In order to compile any servlet, one has to set classpath as

    c:\JavaWebserver2.0\lib\servlet.jar
    >
    > If I set this variable in my autoexec.bat,like set CLASSPATH =

    c:\JavaWebServer2.0\lib\servlet.jar;%CLASSPATH%
    > now If I try to compile the applet
    > javac HelloWorld.java
    > compiler gives me error - javax.servlet.*; &
    > javax.servlet.http.*; not found
    > but if on commmand line I type
    > javac -classpath c:\JavaWebServer2.0\lib\servlet.jar HelloWorld.java
    > then servlet will compile corectly and can be executed on server any idea
    > what is wrong in setting classpath in autoexec.bat file
    > Thanx in Advance
    > Sami
    >
    >




  3. #3
    Sami Guest

    Re: Simple CLASSPATH problem for compilation of servlets in JWS2.0


    Paul, Thanx alot, you were right . I removed those space and now I am able
    to compile servlets, but now I am not able to execute even simple java programs,
    so in short to say, my javac tool is workign fine but cannot do
    java test1 . or whatever...so not able to run anything,,,any comments

    "Paul Clapham" <pclapham@core-mark.com> wrote:
    >Do you have the spaces around the = in your autoexec.bat as well as here?
    >Get rid of them, you're defining an environment variable called
    >CLASSPATH<space> instead of CLASSPATH. And if you want to know what
    >environment variables are set, just type "SET" at the command line.
    >
    >PC2
    >
    >Sami <sa@infobroker.com.au> wrote in message
    >news:3a81f47f$1@news.devx.com...
    >>
    >> I have installed Java Web Server on win98.
    >> In order to compile any servlet, one has to set classpath as

    >c:\JavaWebserver2.0\lib\servlet.jar
    >>
    >> If I set this variable in my autoexec.bat,like set CLASSPATH =

    >c:\JavaWebServer2.0\lib\servlet.jar;%CLASSPATH%
    >> now If I try to compile the applet
    >> javac HelloWorld.java
    >> compiler gives me error - javax.servlet.*; &
    >> javax.servlet.http.*; not found
    >> but if on commmand line I type
    >> javac -classpath c:\JavaWebServer2.0\lib\servlet.jar HelloWorld.java
    >> then servlet will compile corectly and can be executed on server any idea
    >> what is wrong in setting classpath in autoexec.bat file
    >> Thanx in Advance
    >> Sami
    >>
    >>

    >
    >



  4. #4
    sa@infobroker.com.au Guest

    Re: Simple CLASSPATH problem for compilation of servlets in JWS2.0


    >Response:------


    C:\JavaWebServer2.0\bin\httpd -cp C:\myapp\classes


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links