当前位置: 技术问答>java相关
入门的问题,非常抱歉,请指教
来源: 互联网 发布时间:2015-05-06
本文导语: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ...
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
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("");
}
}
这是个简单的HELLOWORLD程序,我在执行它的时候出错,
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
我知道这是很著名的路径问题,但是我实在弄不好,
java -classpath . HelloWorld试过,错误一样
classpath=.;c:jdk1.2libdt.jar;c:jdk1.2libtools.jar
也有,究竟是啥问题,请指点,谢谢!
import javax.servlet.*;
import javax.servlet.http.*;
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("");
}
}
这是个简单的HELLOWORLD程序,我在执行它的时候出错,
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
我知道这是很著名的路径问题,但是我实在弄不好,
java -classpath . HelloWorld试过,错误一样
classpath=.;c:jdk1.2libdt.jar;c:jdk1.2libtools.jar
也有,究竟是啥问题,请指点,谢谢!
|
用java命令执行servlet?
你怎么还用jdk1.2?
你怎么还用jdk1.2?
|
classpath=c:jdk1.4.0libdt.jar;c:jdk1.4.0libtools.jar;.才对。。。