如题,在我安装了JDK在c盘根目录后,修改了环境路径,在命令行打出:javac 回车的时候,出现
Usage:javac <options> <sourcefiles> ...
但用记事本写入如下代码:
public class hello{
public static void main(String []argc){
System.out.println("Hello Word!");
}
}
在编译的时候:
c:\javac hello.java
c:\java hello
的时候显示如下信息:
exception in thread "main" java.lang.NoClassDefFoundError:hello
请问是什么原因啊?
该做什么样的调试?
Usage:javac <options> <sourcefiles> ...
但用记事本写入如下代码:
public class hello{
public static void main(String []argc){
System.out.println("Hello Word!");
}
}
在编译的时候:
c:\javac hello.java
c:\java hello
的时候显示如下信息:
exception in thread "main" java.lang.NoClassDefFoundError:hello
请问是什么原因啊?
该做什么样的调试?
?
String []argc 这个地方写错.同时 你在环境变量的classpath中 最前面加上 .;那句没错~
记得在unix下写shell,有时经常用到.;所以一直怀疑是它的问题.呵呵,谢谢 crazycy(代言人) 和大家!