servlet 的配置问题,快来拿分,在线急

yuanyongyao79 2004-09-27 01:31:02
我安装了jdk1.4和tomcat,我把他们都放在了d盘的server的目录下,jdk1.4的安装目录是jdk,然后我设置环境变量:
path=d:\server\jdk\bin;
classpath=.;d:\server\jdk\lib;d:\server\jdk\lib\dt.jar;d:\server\jdk\lib\tools.jar;d:\server\jdk\lib\servlet.jar;
然后我运行一个servlet测试程序,但是通不过,程序是这样的:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Someservlet extends HttpServlet
{
public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
{
PrintWriter out=response.getWriter();
}
}
我是用JCreator Pro编辑软件运行的,我是一直用这个工具的,运行其他java程序没有出过错,它显示的错误是这样的:
--------------------Configuration: <Default>--------------------
E:\java\Someservlet.java:2: package javax.servlet does not exist
import javax.servlet.*;
^
E:\java\Someservlet.java:3: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
E:\java\Someservlet.java:4: cannot resolve symbol
symbol : class HttpServlet
location: class Someservlet
public class Someservlet extends HttpServlet
^
E:\java\Someservlet.java:6: cannot resolve symbol
symbol : class HttpServletRequest
location: class Someservlet
public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
^
E:\java\Someservlet.java:6: cannot resolve symbol
symbol : class HttpServletResponse
location: class Someservlet
public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
^
E:\java\Someservlet.java:6: cannot resolve symbol
symbol : class ServletException
location: class Someservlet
public void doGet (HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException
^
6 errors

Process completed.
我想这问题应该是servlet没有配置好,但是我已经不知道该怎么配置了,希望各位指点一二,多谢了!!!
...全文
73 点赞 收藏 6
写回复
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
xunyiren 2004-09-27
把servlet.jar从tomcat中拷到jdk的\jre\lib\ext目录下
回复
MARS.nEIL 2004-09-27
tomcat与jdk是两个不同的目录啊.
回复
yuanyongyao79 2004-09-27
不是呀,我已经把servlet.jar从tomcat中拷到jdk的lib下
回复
xunyiren 2004-09-27
classpath=.;d:\server\jdk\lib;d:\server\jdk\lib\dt.jar;d:\server\jdk\lib\tools.jar;d:\server\jdk\lib\servlet.jar;中


d:\server\jdk\lib\servlet.jar==>d:\server\tomcat\common\lib\servlet.jar

回复
bbmer 2004-09-27
CATALINA_HOME=d:\server\tomcat
回复
studyday 2004-09-27
你设置了环境变量吗?
set tomcat_home = "d:\server\tomcat"
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告