当前位置: 技术问答>java相关
这段程序编译为什么有错误,请指点
来源: 互联网 发布时间:2015-11-01
本文导语: 用javac编译提示 package java.servlet do not exist import java.servlet.*; ^ 我在autoexect.bat中是这样些的 SET PATH=C:jdk1.3bin;C:jdk1.3;C:jdk1.3lib;c:;c:windows;c:windowscommand SET CLASSPATH=.;C:jdk1.3libservlet.jar;c:jdk1.3libjspengine.jar;c:jdk1...
用javac编译提示
package java.servlet do not exist
import java.servlet.*;
^
我在autoexect.bat中是这样些的
SET PATH=C:jdk1.3bin;C:jdk1.3;C:jdk1.3lib;c:;c:windows;c:windowscommand
SET CLASSPATH=.;C:jdk1.3libservlet.jar;c:jdk1.3libjspengine.jar;c:jdk1.3libtools.jar;c:jdk1.3libxml.jar
set JAVA_HOME=C:jdk1.3
C:jdk1.3libservlet.jar这个文件也存在jswdk放在C:jdk1.3目录下
我在程序中是这样写的
import java.io.*;
import java.servlet.*;
import javax.servlet.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
}
}
我实在是搞不懂了,请各位高手指教.
package java.servlet do not exist
import java.servlet.*;
^
我在autoexect.bat中是这样些的
SET PATH=C:jdk1.3bin;C:jdk1.3;C:jdk1.3lib;c:;c:windows;c:windowscommand
SET CLASSPATH=.;C:jdk1.3libservlet.jar;c:jdk1.3libjspengine.jar;c:jdk1.3libtools.jar;c:jdk1.3libxml.jar
set JAVA_HOME=C:jdk1.3
C:jdk1.3libservlet.jar这个文件也存在jswdk放在C:jdk1.3目录下
我在程序中是这样写的
import java.io.*;
import java.servlet.*;
import javax.servlet.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
out.println("Hello World!");
out.println("");
out.println("");
}
}
我实在是搞不懂了,请各位高手指教.
|
声明两个:
import javax.servlet.*;
import javax.servlet.http.*;
还有,是否引进了servlet包
import javax.servlet.*;
import javax.servlet.http.*;
还有,是否引进了servlet包