This aspect applies to the error: Java can not find or load the main class, generally cannot find the path of the class, the problem is on the CLASSPATH environment variable, of course, this is the majority of large probability of the error point
Do not rule out according to personal circumstances, so think of the great leader Chairman Mao's words: Specific problems specific analysis
1, the entire configuration environment process, no longer repeat, please follow the following blog configuration (I think a very full article)
Http://www.cnblogs.com/liuhongfeng/p/4177568.html
2. Check whether the environment variable is configured successfully
Run cmd input java,javac, java-version (space between Java and-version)
(1) Java
(2) Javac
(3) Java-version
The first two--java/javac--can be output normally as a tutorial, but:
Input: Java-version Error
----------------------------------------------------------------------
Error: The main class could not be found or could not be loaded-version
Reason: java.lang.ClassNotFoundException:-version
-----------------------------------------------------------------------
3, solve java-version error problem
(1) Under System variables, create a new classpath variable and add
. ; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar;
Remember: start.; End add;
Restart cmd for next run, and then Run Java-version
(2) If not, then try adding an identical classpath to the system variable as well
If you have any questions, please leave a message.
JAVAC DetailXBasic TranslationN. java compiler ProgramNetwork explanationJavac: Compiler Javac HelloWorld: OK
When configuring environment variables, CMD runs java-version, error: The main class cannot be found or cannot be loaded-version