Hi,
I try to work with the javax.servlet and javax.servlet.http classes.
So first I downloaded them from java.sun.com. The download results in a servlet.jar file.
Simply putting this file in jre directory does not enable Eclipse (3.3) to resolve the import for javax.servlet and javax.servlet.http.
Then I have downloaded the J2SE jdk 1.5 update 11 winstall package from java.sun.com and installed the JDK + its own JRE.
Eclipse is not able to resolve the import for javax.servlet and javax.servlet.http.
Then I have created a JAVA_HOME env. var that points to: C:\Program Files\Java\jdk1.5.0_11\lib and copied servlet.jar to this direcory.
Eclipse is still not able to resolve the import for javax.servlet and javax.servlet.http.
What (more) is needed to enable Eclipse to resolve the import for javax.servlet and javax.servlet.http?
Any help is much appreciated!
Andrew Thompson - 24 Apr 2007 17:33 GMT
...
>What (more) is needed to enable Eclipse to resolve the
> import for javax.servlet and javax.servlet.http?
Add the jar's to the compilation and runtime classpath.
If you are not able to figure how to do that (I suggest,
in the first instance 'F1 - search - classpath - enter',
then if that does not work for you,) take it up on one
of the Eclipse groups, found here.
<http://www.eclipse.org/newsgroups/>

Signature
Andrew Thompson
http://www.athompson.info/andrew/
newbie_at_tomcat - 24 Apr 2007 21:25 GMT
Hi,
I've followed the suggestion of Andrew Thompson (thanks Andrew) and this solves my immediate problem. I've added a (new) variable that points to the lib directory containing the servlet.jar file. But this only applies to the one project that contains my package. Is is possible to define this (Eclipse) system wide or do I need to do this for every project I (might) want to use javax.servlet and javax.servlet.http in?
Thanks in advance for any helpful answer.