Home arrow static arrow Java Programming [Archive] - Cannot import javax.servlet onto classpath
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Cannot import javax.servlet onto classpath
This topic has 3 replies on 1 page.

Posts:17
Registered: 8/18/03
Cannot import javax.servlet onto classpath  
Aug 4, 2004 4:55 AM



 
Hi guys, newbie question.

Im using jedit on linux; compiling with j2sdk1.4.2_04 but it will not pick up the javax.serlet
classes!! Is there an add on I need to download to develop j2ee stuff, as I thought j2sdk1.4.2_04 was all that was required.

Thanks in advance
 

Posts:21,718
Registered: 98-02-20
Re: Cannot import javax.servlet onto classpath  
Aug 4, 2004 4:59 AM (reply 1 of 3)



 
Wrong. You need a JAR that has the javax.servlet and javax.servlet.http packages, and they don't come with the J2SE.

If you want to run servlets/JSPs, you must have a servlet/JSP engine. If you already have one, root around for the servlet JAR. If don't, download [url=http://jakarta.apache.org/tomcat]Tomcat[/url]. It's Sun's reference implementation for the servlet/JSP specifications. The servlet JAR will be in the TOMCAT_HOME/common/lib directory.

%
 

Posts:2,909
Registered: 13.8.2003
Re: Cannot import javax.servlet onto classpath  
Aug 4, 2004 4:59 AM (reply 2 of 3)



 
You need to download it separately. j2sdk is for the standard edition, enterprise edition and micro edition have their own additional stuff.
 

Posts:19,725
Registered: 9/26/01
Re: Cannot import javax.servlet onto classpath  
Aug 4, 2004 4:59 AM (reply 3 of 3)



 
javax.servlet is J2EE - you need to add a (set of) implementation jar(s) to your classpath. How you add them to the classpath varies - but a word of advice - don't simply add them to a system environment variable named "CLASSPATH".
 
This topic has 3 replies on 1 page.