0

Java サーブレットのコンパイルで大きな問題が発生しています。私が見る限り、必要な作業はすべて完了しており、Tomcat 7 は正しくインストールされており、Tomcat は動作しています。私が理解しているように、クラスパスに servlet.jar パッケージを追加する必要があります。

クラスパス環境変数を編集して、これを行いました。

CLASSPATH=C:\Program Files\Apache Software Foundation\Tomcat 7.0\lib\servlet-api.jar

残念ながら、まだうまくいきません。Java サーブレットをコンパイルできません。javax.servlets.

Window 7 を使用しています。

4

1 に答える 1

0

Tomcat already comes with Servlet related stuff jar files. You don't need to worry about them. You have make them available for your application to compile by adding those in your classpath. But not including into the application build.

If your compiler complains about javax.servlets. so you are missing the Java EE jar in your classpath. You need to add the Java EE jar file to your classpath (the application classpath). You can download them following this. But make sure you do not include them into your build.

于 2012-11-01T15:19:50.243 に答える