简体   繁体   English

为什么即使设置了类路径后,包javax.servlet仍然不存在?

[英]Why does package javax.servlet still does not exist even after setting the classpath?

I am using jdk1.5.0 and Tomcat 5.5. 我正在使用jdk1.5.0和Tomcat 5.5。 I recently edited the class path to 我最近将课程路径编辑为

javac -cp.;/Program Files/Apache Software Foundation/Tomcat 5.5/lib/servlet-api.jar

and i also created a default servlet folder i was required to create which should be located at 并且我还创建了一个默认的servlet文件夹,我需要创建该文件夹,该文件夹应位于

C:/Program Files/Apache Software Foundation/Tomcat 5.5/webapps/ROOT/WEB-INF/classes. 

but i still get the same errors 但我仍然遇到相同的错误

package javax.servlet does not exist
package javax.servlet.http does not exist

and i don't know if 我不知道是否

Failed to load Main-class manifest attribute

from JVM Launcher has nothing to do with the errors i got. 来自JVM Launcher的错误与我得到的错误无关。

Thank you for taking time to help. 感谢您抽出宝贵的时间来帮助您。

Try adding quotes and using backslashes. 尝试添加引号并使用反斜杠。 I think the space in "Program Files" etc. will break the line into another argument. 我认为“程序文件”等中的空格将把该行分成另一个参数。

javac -cp ".;C:\Program Files\Apache Software Foundation\Tomcat 5.5\lib\servlet-api.jar"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM