"Song Hongkang Learning Diary 1" Questions about environment variable settings--cannot find or load main class Java

Source: Internet
Author: User

Busy all day, and finally by their own little foolish, but also learn a lot, know how to solve problems.

The problem is that when I compile my first applet HelloWorld in the CMD run environment, the JAVAC command can run, but the following occurs after the Java command.

  

In the experience of the Baidu Blog Park all kinds of search is not the case, finally asked the roommate finally found that the original is my program written wrong. At run time, it should be Java HelloWorld, no suffix. This also shows that I learn how not serious, of course, with the body uncomfortable restless (I am not a girl) also has a relationship, next time will be well mastered.

To get down to the chase, let me briefly describe the process of configuring environment variables.

First of all, my JDK is installed in C:\Program files\java\jdk1.8.0_60; Right click on Computer-Properties-Advanced system settings-environment variables,

Then we start setting up the variables. The first is to set the java_home, note that if you do not have to create a new one, as shown below.

The value of the variable under Java_home is written like this: C:\Program files\java\jdk1.8.0_60.

Is the directory that your JDK installs.

Then set the path variable, ".;  %java_home%\bin; "," "in the content, a punctuation not less." The meaning is in the bin directory under Java_home.

Finally, Classpath: ".; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; ".

This is probably the case, in fact, it is very simple, no online said so complicated.

"Song Hongkang Learning Diary 1" Questions about environment variable settings--cannot find or load main class Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.