出现以下错误,怎么办。
C:\java_temp>javac hello_world.java
hello_world.java:1: class Test is public, should be declared in a file named Tes
t.java
public class Test{
^
hello_world.java:2: cannot resolve symbol
symbol : class string
location: class Test
public static void main(string args[])
^
hello_world.java:4: package system does not exist
system.out.println("Hello World");
^
3 errors
我的j2sdk安装在 c:\java 下
环境变量设置如下
变量名 变量值
java_home c:\java\j2sdk
path c:\java\j2sdk\bin
classpath .:C:\java\j2sdk\lib\dt.jar;C:\java\j2sdk\lib\tools.jar
hello_world.java 放在 java_temp目录下。
源文件为:
public class Test{
public static void main(string args[])
{
system.out.println("Hello World");
}
}
怎么办?