Hallo Forum!
Ich habe genau das gleiche Problem, aber bei mir hat das importieren des .jar files nach oben genanntem Schema leider nicht weitergeholfen...
Ich versuche nun wirklich schon seit Stunden ein einfaches HelloWorld Servlet zu kompilieren aber ich krieg immer die typischen Fehlermeldungen alla "cannot resolve symbol. symbol: Class HttpServlet" oder "package javax.servlet does not exist"...
Meine versuche: Setzen der Classpath-Variablen -> Kein erfolg
Aufruf des Javac-Compilers mit -classpath option -> Kein erfolg
Einbinden des servlet-api.jar ins Eclipse-Projekt -> Kein erfolg
ich werde langsam verrückt... :-(
Hier noch ein Post von mir aus dem SUN-Forum (leider keine Antworten) in dem
nochmal alle Details nachzulesen sind (auf englisch):
--------------------------------------------------------------------------------------------------------------------------------
Hi Forum,
I`ve been sitting here for hours trying to compile a simple "Hello World"-Servlet.
I think there's no need to post the sourcecode, because there are a lot of examples around
I'm using :
Eclipse 3.0.2
Apache Tomcat 5.5 using jre 1.5.0_02
Ant 1.6.3
j2sdk 1.4.2
under WinXP Home Edition
The problem is, that when I´m trying to compile the servlet get plenty of errors like
"cannot resolve symbol. symbol: class HttpServlet" etc....
or "package javax.servlet does not exist"...
I've been searching around the internet and this forum for hours now and only found the hint about the CLASSPATH-Variable butt this couldn't fix my problem.
In my opinion all Classpath-settings are allright:
CLASSPATH=
".; C:\Programme\Apache Software Foundation\Tomcat 5.5\bin\bootstrap.jar; C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib\servlet-api.jar; C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib\jsp-api.jar; C:\Programme\Apache Software Foundation\Tomcat 5.5\common\lib\j2ee.jar"
ANT_HOME="c:\Programme\Apache Software Foundation\apache-ant-1.6.3"
JAVA_HOME="C:\j2sdk1.4.2"
Since my first post tried to use the classpath directly with the javac-command
(sth. like javac -classpath c:\...\jsp-api.jar \myprojekt\src\...* )
=> the same effect: "cannot resolve symbol: Class HttpServlet"
I also imported the .jar files directly into my eclipse-project via
"project->properties->Java Build Path-> Libraries"
=> it still doesnt fix my problem.... :-(
Ich muss unbedingt ein Projekt für die Uni bearbeiten, komm so aber einfach nicht weiter!
HILFE!
Danke, Fabi