Topic: 请问为什么JAVA程序不能编译?该怎么办!多谢!

  Print this page

1.请问为什么JAVA程序不能编译?该怎么办!多谢! Copy to clipboard
Posted by: guopu1
Posted on: 2005-04-07 12:02

你好:
请问为什么JAVA程序不能编译?该怎么办!多谢!
我在win2000 C:上安装的是jswdk-1.0和tomcat4.1,环境变量设为:
CLASSPATH=.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\common\lib\servlet.jar;%CATALINA_HOME%\common\lib\commons-logging-api.jar;
PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;c:\j2sdk1.4.2_07\bin
编译时屏幕为:
C:\test>javac test.java
test.java:4: package javax.servlet does not exist
import javax.servlet.ServletException;
^
test.java:5: package javax.servlet.http does not exist
import javax.servlet.http.HttpServlet;
^
test.java:6: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletRequest;
^
test.java:7: package javax.servlet.http does not exist
import javax.servlet.http.HttpServletResponse;
^
test.java:8: cannot resolve symbol
symbol : class HttpServlet
location: class test.Test
public class Test extends HttpServlet {
^
test.java:9: cannot resolve symbol
symbol : class HttpServletRequest
location: class test.Test
protected void doGet(HttpServletRequest request, HttpServletResponse response)
^
test.java:9: cannot resolve symbol
symbol : class HttpServletResponse
location: class test.Test
protected void doGet(HttpServletRequest request, HttpServletResponse response)
^
test.java:10: cannot resolve symbol
symbol : class ServletException
location: class test.Test
throws ServletException, IOException {
^
8 errors

C:\test>

2.Re:请问为什么JAVA程序不能编译?该怎么办!多谢! [Re: guopu1] Copy to clipboard
Posted by: why
Posted on: 2005-04-07 12:26

has CATALINA_HOME been set correctly?

btw, I don't think you need jswdk-1.0 .

3.Re:请问为什么JAVA程序不能编译?该怎么办!多谢! [Re: guopu1] Copy to clipboard
Posted by: guopu1
Posted on: 2005-04-07 12:50

CATALINA_HOME has been set correctly.
is not jswdk-1.0 . be j2sdk1.4
thank you for answering my question but the question is still

4.Re:请问为什么JAVA程序不能编译?该怎么办!多谢! [Re: guopu1] Copy to clipboard
Posted by: why
Posted on: 2005-04-07 19:26

guopu1 wrote:
CATALINA_HOME has been set correctly.

I bet not, where did you set it and could you please show us the result of the command line command
dir %CATALINA_HOME%\common\lib\servlet.jar

5.Re:请问为什么JAVA程序不能编译?该怎么办!多谢! [Re: guopu1] Copy to clipboard
Posted by: ginger547
Posted on: 2005-04-08 14:44

i agree with the boss


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923