Java compiled by, why does the run prompt not find or load the main class?
https://www.zhihu.com/question/36537093
Here is a possible solution to the program that contains the package keyword, "Unable to find or cannot load the main class" When using terminal to run the program.
For example, the program name is Helloworldtest.java, and the program contains the package HelloWorld statement, which is located in the Javatest directory, which is Javatest/helloworld/helloworldtest.java.
You should run the JAVAC directive in the same directory as the Java file, running Javac in the HelloWorld directory Helloworldtest.java
Run the Java directive in the upper directory where the package resides , running Java helloworld.helloworldtest in the Javatest directory
Because it is Java that is studied in OS X environment, it is not familiar with the setting of Classpath and so on, perhaps this method is the same meaning as part of the main answer.
Gu Zhifang
Links: https://www.zhihu.com/question/36537093/answer/206814470
Source: Know
Copyright belongs to the author. Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Java compiled by, why does the run prompt not find or load the main class?