文件目录
$ pwd
/Users/apple/Desktop/springt/javacTest
$ tree
.
└── src
└── com
└── subject
└── math
├── Hi.class
└── Hi.jav
Hi,java 文件
package com.subject.math;
public class Hi{
public static void main(String args[]){
System.out.println("hi");
}
}
但是在编译完成后,却出现ClassNotFoundException:
$ java /Users/apple/Desktop/springt/javacTest/src/Hi.class
Error: Could not find or load main class .Users.apple.Desktop.springt.javacTest.src.Hi.class
Caused by: java.lang.ClassNotFoundException: /Users/apple/Desktop/springt/javacTest/src/Hi/class
为什么编译成功却运行失败?
元芳怎么了
相关分类