1.package must correspond to file path
package is com.challenger
path must be com/challenger/
2.javac use -d to output classes into file path automaticly
javac -d classes src/MyClass.java
3.javac use -sourcepath to tel where to find source code file
javac -sourcepath src -d classes src/MyClass.java
4.java use -classpath to find classes
java -classpath MyClass
标签:java,javac,classes,file,MyClass,path From: https://www.cnblogs.com/lsjava/p/16894530.html