java 错误: 找不到或无法加载主类
原因:运行时用类名而不是类名.class
案例:
1… 脚本:helloworld.java
class HelloBaby {
public static void main(String args[]) {
System.out.println("hello world");
}
}
- 编译和运行
D:YoungProjectsjava_sggcodeday01>javac helloworld.java D:YoungProjectsjava_sggcodeday01>java HelloBaby.class 错误: 找不到或无法加载主类 HelloBaby.class D:YoungProjectsjava_sggcodeday01>java HelloBaby hello world
差点就给劝退了!!!



