Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Re: faulty fix for (javax.servlet does not exist)

Jacob Kjome

2003-06-01

Replies:


You have an invalid classpath. Note that you must add each and every .jar
file to the classpath. It is invalid to specify *.jar. The only way that
would work is by using a batch file and looping through all jar files in a
directly and then adding each to the classpath for each iteration. Fix
that and your compilation will start working properly. I'd suggest
learning about Ant to do you builds as well.

Jake

At 01:56 AM 6/1/2003 -0500, you wrote:
>This website http://www.sitepoint.com/article/509/3 says all I have to do
>is put servlet.jar in my classpath to solve my problems. Unfortunitally,
>it doesn't seem to work.
>
>
>This is my path
>------------------
>$ echo $CLASSPATH
>/usr/java/j2sdkee1.4/lib/*.jar:/usr/java/j2sdk1.4.1_02/lib/*.jar:/var/tomcat4/server/lib/*.jar:/var/tomcat4/common/lib/*.jar
>
>The classpath is set in the .bashrc, but that should effect the javac
>command right?!? I've also done the classpath without the *.jar by
>explicitly naming each of the jar files.... talk about a pain.
>
>
>This is my error
>---------------------------------------------------------------------------------------------------------
>$ javac MultiServlet.java
>MultiServlet.java:1: package javax.servlet does not exist
>import javax.servlet.*;
>^
>MultiServlet.java:2: package javax.servlet.http does not exist
>import javax.servlet.http.*;
>^
>-------------------------------------------------------------------------------
>
>
>
>these are installed:
>---------------------------------
>tomcat4-webapps-4.1.24-full.2jpp
>tomcat4-4.1.24-full.2jpp
>tomcat4-admin-webapps-4.1.24-full.2jpp
>j2re1.4.1_02
>j2sdk1.4.1_02
>j2sdkee1.4
>
>
>The tomcat lib jar files
>--------------------------------------
>classes $ ls /var/tomcat4/common/lib/
>activation.jar       commons-dbcp.jar      jasper-compiler.jar
>jndi.jar   naming-common.jar   servlet.jar
>ant.jar            commons-logging-api.jar jasper-runtime.jar
>jta.jar    naming-factory.jar
>commons-collections.jar commons-pool.jar      jdbc2_0-stdext.jar
>mailapi.jar naming-resources.jar
>
>classes $ ls /var/tomcat4/server/lib/
>catalina-ant.jar     commons-logging.jar   mx4j.license
>servlets-manager.jar    tomcat-jk2.jar
>catalina.jar        commons-modeler.jar   servlets-cgi.renametojar
>servlets-ssi.renametojar tomcat-jk.jar
>commons-beanutils.jar  jaas.jar           servlets-common.jar
>servlets-webdav.jar     tomcat-util.jar
>commons-digester.jar   jakarta-regexp-1.2.jar servlets-default.jar
>tomcat-coyote.jar      tomcat-warp.jar
>commons-fileupload.jar mx4j-jmx.jar        servlets-invoker.jar
>tomcat-http11.jar
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
>For additional commands, e-mail: tomcat-user-help@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.