Forum Moderators: phranque

Message Too Old, No Replies

Compiling Java

j2sdk1.4 - javax.servlets

         

gbergeron

12:52 am on May 27, 2003 (gmt 0)

10+ Year Member



Hi

I'm trying to compile a java program that needs the class set from
import javax.servlet.*;

I though all that stuff came with 1.4. Does anyone know exactly where I can get this library (I tried the Sun Website but didn't see it).

bcc1234

1:29 am on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Get servlet.jar. It contains servlet api.

gbergeron

2:05 am on May 27, 2003 (gmt 0)

10+ Year Member



Thanks. I have the jar file now. It doesn't seem to pick it up. Shouldn't classpath=C:\j2sdk1.4.1_02\lib\tools.jar;C:\j2sdk1.4.1_02\lib\servlet.jar;.;
shouldn't this work?

Or do I have to logoff first when I update an existing environment variable?

bcc1234

2:48 am on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Once you got it in your classpath, just make sure it's there and it will work.
Try echo $CLASSPATH and check that you got the jar listed.

txbakers

3:40 am on May 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



servlet.jar, and the other jsp specific jars are automatically installed when you install Tomcat.

The classpath is also set, so you don't have to mess with that.

Go ahead and install Tomcat, then, if you don't want to use it, you can turn the service to Manual, and never start it. That's what I did when I needed those other jar files, but not tomcat.

FourDegreez

6:08 pm on May 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can also pass the classpath to the compiler:

javac -classpath .;this.jar;that.jar MyFile.java