java编译问题大家帮忙

yeslebk 2004-04-08 11:29:13
classpath下明明有javax.servlet.jar包,编译时出现不存在错误,请高手帮忙,谢谢!

D:\jboss323\myproject\src>set classpath=.;D:\au2cn\j2sdk141\lib\tools.jar;D:\jbo
ss323\client\jbossall-client.jar;D:\jboss323\client\jboss-client.jar;D:\jboss323
\client\jboss-iiop-client.jar;D:\jboss323\server\default\lib\jnpserver.jar;D:\jb
oss323\client\jnp-client.jar;D:\jboss323\client\log4j.jar;D:\jboss323\client\jbo
ss-j2ee.jar; D:\jboss323\server\all\lib\javax.servlet.jar

D:\jboss323\myproject\src>javac *.java
HelloServlet.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
HelloServlet.java:5: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloServlet.java:19: cannot resolve symbol
symbol : class HttpServlet
location: class hello.HelloServlet
public class HelloServlet extends HttpServlet
^
HelloServlet.java:25: cannot resolve symbol
symbol : class ServletException
location: class hello.HelloServlet
public void init() throws ServletException
^
HelloServlet.java:79: cannot resolve symbol
symbol : class HttpServletRequest
location: class hello.HelloServlet
public void service(HttpServletRequest req,HttpServletResponse res) throws IOExc
eption
^
HelloServlet.java:79: cannot resolve symbol
symbol : class HttpServletResponse
location: class hello.HelloServlet
public void service(HttpServletRequest req,HttpServletResponse res) throws IOExc
eption
^
HelloWorld.java:5: package javax.servlet does not exist
import javax.servlet.*;
^
HelloWorld.java:7: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
HelloWorld.java:9: cannot resolve symbol
symbol : class HttpServlet
location: class hello.HelloWorld
public class HelloWorld extends HttpServlet
^
HelloWorld.java:13: cannot resolve symbol
symbol : class HttpServletRequest
location: class hello.HelloWorld
public void doGet(HttpServletRequest request, HttpServletResponse response) thro
ws IOException, ServletException
^
HelloWorld.java:13: cannot resolve symbol
symbol : class HttpServletResponse
location: class hello.HelloWorld
public void doGet(HttpServletRequest request, HttpServletResponse response) thro
ws IOException, ServletException
^
HelloWorld.java:13: cannot resolve symbol
symbol : class ServletException
location: class hello.HelloWorld
public void doGet(HttpServletRequest request, HttpServletResponse response) thro
ws IOException, ServletException

^
HelloServlet.java:33: cannot resolve symbol
symbol : method getInitParameter (java.lang.String)
location: class hello.HelloServlet
String initCtxFactory = getInitParameter(Context.INITIAL_CONTEXT_FACTORY);
^
HelloServlet.java:35: cannot resolve symbol
symbol : method getInitParameter (java.lang.String)
location: class hello.HelloServlet
String providerURL = getInitParameter(Context.PROVIDER_URL);
^
HelloServlet.java:67: cannot resolve symbol
symbol : class ServletException
location: class hello.HelloServlet
throw new ServletException(ne.toString());
^
HelloServlet.java:73: cannot resolve symbol
symbol : class ServletException
location: class hello.HelloServlet
throw new ServletException(e.toString());
^
16 errors
...全文
15 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
zhangseng 2004-04-09
  • 打赏
  • 举报
回复
应该是路径不对,好好检查一下
ninghao37 2004-04-09
  • 打赏
  • 举报
回复
up

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧