不好意思,上次没有把错误给贴出来!!! D:\Tomcat 5.0\webapps\ROOT\WEB-INF\servlet>javac helloword.java helloword.java:3: package javax.servlet does not exist import javax.servlet.*; ^ helloword.java:4: package javax.servlet.http does not exist import javax.servlet.http.*; ^ helloword.java:5: cannot resolve symbol symbol : class HttpServlet location: class helloword public class helloword extends HttpServlet{ ^ helloword.java:6: cannot resolve symbol symbol : class HttpServletRequest location: class helloword public Void doGet(HttpServletRequest request,HttpServletResponse response) ^ helloword.java:6: cannot resolve symbol symbol : class HttpServletResponse location: class helloword public Void doGet(HttpServletRequest request,HttpServletResponse response) ^ helloword.java:7: cannot resolve symbol symbol : class ServletException location: class helloword throws IOException,ServletException ^ 6 errors
helloworld.java吧!
-------------------------------------------------------------------------------
这里的void首字母大写了,应该是void,不过这个应该是笔误吧。Path和ClassPath设置我看没什么错误啊?还是把出错提示帖出来吧。
D:\Tomcat 5.0\webapps\ROOT\WEB-INF\servlet>javac helloword.java
helloword.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
helloword.java:4: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
helloword.java:5: cannot resolve symbol
symbol : class HttpServlet
location: class helloword
public class helloword extends HttpServlet{
^
helloword.java:6: cannot resolve symbol
symbol : class HttpServletRequest
location: class helloword
public Void doGet(HttpServletRequest request,HttpServletResponse response)
^
helloword.java:6: cannot resolve symbol
symbol : class HttpServletResponse
location: class helloword
public Void doGet(HttpServletRequest request,HttpServletResponse response)
^
helloword.java:7: cannot resolve symbol
symbol : class ServletException
location: class helloword
throws IOException,ServletException
^
6 errors
import javax.servlet.*;
import javax.servlet.http.*;
这些文件在servlet-api.jar中可以找到。
如:
CLASSPATH
.;%JDBC_HOME%\lib\mssqlserver.jar;%JDBC_HOME%\lib\msbase.jar;%JDBC_HOME%\lib\msutil.jar;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet.jar;;%CATALINA_HOME%\common\lib\servlet-api.jar
放进去了,还是原先的错误啊。大侠要帮帮我啊,我都要郁闷死了,最基本的我都不会。