tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Kirk <Christopher.K...@gtl.com>
Subject RE: ClassPath question?
Date Fri, 02 Feb 2001 12:24:30 GMT
_Normally_ the core java libraries are inserted onto the classpath for you,
hence
you may not always have to setup a classpath.

javax.* is not part of the core libraries, its name actually stands for 
'java extensions'. Over time some of these extensions, such as swing (javax.
swing)  
have made it into the normal distribution but others such as servlets have
not.

If you want to see what is or is not in the core distribution, go into the
libs
directory of the JVM installation of the JRE and open up rt.jar.. in there
you 
will find java.io, java.util etc etc.

- CK

Brainbench MVP Java2.

> -----Original Message-----
> From: Jian Zhang [mailto:jian@FLYINGCOLOR.com]
> Sent: 02 February 2001 11:51
> To: 'tomcat-user@jakarta.apache.org'
> Subject: RE: ClassPath question?
> 
> 
> Thanks. I just tried "/usr/local/tomcat/lib/servlet.jar" and 
> it worked.
> 
> I noticed that the first line HelloWorld.java file is 
> "import java.io.*"
> But it did not create any problem on compiling given previous 
> classpath.
> 
> Does it mean java libs have some difference from each other?
> 
> 
> jian
> 
> 
> > As far as classpaths are concerned, you can think of a jar file as a
> > directory (not a file). That is, unlike files (.class files 
> > especially) you
> > must explicitly specify the jar file on the class path.
> > 
> > That is, to pick up the servlet jar file, specify the 
> > following path. You
> > will have to do a similar thing for each of the other jar files too.
> > 
> > /usr/local/tomcat/lib/servlet.jar
> > 
> > 
> > - Ck
> > 
> > Brainbench MVP Java2.
> > 
> > 
> > > -----Original Message-----
> > > From: Jian Zhang [mailto:jian@FLYINGCOLOR.com]
> > > Sent: 02 February 2001 11:23
> > > To: 'tomcat-user@jakarta.apache.org'
> > > Subject: ClassPath question?
> > > 
> > > 
> > > Hello;
> > > 
> > > Can anyone help with this compile error msg:
> > > 
> > > javac HelloWorld.java
> > > 
> > > HelloWorld.java:1: Package javax.servlet not found in import.
> > > import javax.servlet.*;
> > >        ^
> > > I have included the servlet.jar in my classpath:
> > > 
> > > printenv CLASSPATH
> > > /usr/local/jdk1.2.2/lib:/usr/local/tomcat/lib:/usr/local/ant/lib
> > > 
> > > and servlet.jar is in the folder /usr/local/tomcat/lib
> > > 
> > > what have I missed?
> > > 
> > > Thanks in advance
> > > 
> > > jian
> > > 
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > > For additional commands, email: 
> tomcat-user-help@jakarta.apache.org
> > > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, email: tomcat-user-help@jakarta.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org
> 

Mime
View raw message