Problem:
Input: java -version Error
Error: Main class-version cannot be found or cannot be loaded
(Related video tutorial sharing: java video tutorial)
Solution:
Under system variables, create a new CLASSPATH variable and add
.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;
Note: Add ## at the beginning.; at the end #;Next time you run it, restart cmd and then run java -version.
Related tutorial sharing:
java introductory tutorialThe above is the detailed content of cmd running 'java -version' prompts that the main class cannot be found or cannot be loaded. For more information, please follow other related articles on the PHP Chinese website!