Java Configuration Environment Variables--detailed article

Source: Internet
Author: User

Java Configuration Environment Variables detailed chapter

Before because the computer system has failed, reinstall the system, and then need to reconfigure the environment variables, originally thought to learn Java also has more than two years, configuration of environment variables is not a piece of cake, but began to configure the time or to get the majority of days, search for a lot of online information, the environment variable to the configuration, the heart is quite feeling, Configuration environment variables may seem simple but there are a lot of small details to note, sometimes a little attention will be card for a long time, so here to summarize the knowledge of configuration environment variables, and the details listed, I hope to help other beginners Java learners (recommended to look at other diagram of the configuration tutorial, configuration is not successful in this post)

1. Go to Oracle website to download the JDK, download and click Install (remember to download the full JDK, do not download only the JRE, or the subsequent configuration environment variables will not be able to do, here to note the installed directory), after the installation of the cmd command, Java or java-version Check to see if the installation was successful (there is no semicolon after java-version, otherwise you will not be able to read the version information).

2. Configure environment variables: The main operation of the system variables inside the three environment variables (I use WIN10 here):

My Computer-Properties-Advanced system settings-System variables

1. Java_home (no new), Value: D:\JAVASDK (Install your own JDK installation directory, mine is this, do not lose space to enter)

2. CLASSPATH not on the new value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (no less than one character, including the preceding dot, and the trailing semicolon)

3. Path: At the end of the variable value of the long string of path, add;%java_home%\bin;%java_home%\jre\bin; (in addition to the previous look at the end of the variable is not a semicolon, environment variables to be separated by semicolons, if already have, then the string of characters in front of the semicolon to remove a good, not to remove the back)

3. Check whether the configuration is successful, after successfully installing the JDK, the console (cmd) input Java or java-version can display a large list of information, really see if the environment variable is installed successfully

Javac command, if a lot of information also appears to indicate that the installation was successful, the configuration fails, it will prompt ' Javac ' is not an internal or external command. So be sure to be careful when configuring.

4. Configuration Essentials Summary: The environment variable configuration may seem simple, but there are many small details to be aware of, it is possible to pay attention to the configuration failure, so you should be careful.

1. Key one: Download the JDK must be downloaded, including the JRE, if you accidentally downloaded the JRE, then the environment variable configuration, regardless of how the correct method can not be configured successfully.

2. Point two: The environment variable configuration is actually the configuration of three variables, the operation of the three variables are in the system variable inside:

The value of the Java_home variable is your JDK installation directory, which is installed by default in directories such as the C-drive programfile (the upper level of the bin directory, not including the bin folder), so be sure to pay attention to the installation location, do not follow the online other people's installation location directly copied. The subsequent variables are references to the position of the java_home variable, so this place cannot be faulted.

Path variable, before you enter the value of the variable, look at the end of the preceding variable to see if there is no semicolon at the end, no direct loss of the above string, and some words to remove the preceding semicolon. When editing the path variable, it is recommended to directly click Edit Text directly paste the code to the last side, do not create a new interface directly, it is easy to add other characters.

3. After editing the variable, be sure to point to two OK to save the entry into effect, and then reopen the command console input Javac to test, is to turn off and reopen, if still on the original console input, it is likely to fail. This article should also be a point that many people easily omit, remember to remember!

5. Finally: The configuration environment variable is the first Java beginner learning problem, many Java small white has been planted in this, the configuration as long as careful, there is no big problem.

Four-Pole Sword

Java Configuration Environment Variables--detailed article

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.