Home > Java > Javagetting Started > cmd running 'java -version' prompts that the main class cannot be found or cannot be loaded

cmd running 'java -version' prompts that the main class cannot be found or cannot be loaded

王林
Release: 2020-02-05 16:17:26
Original
5500 people have browsed it

cmd running 'java -version' prompts that the main class cannot be found or cannot be loaded

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 tutorial

The 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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template