Java environment Variable Configuration tutorial

Source: Internet
Author: User
Tags wrapper

Windows Ten Java environment variable configuration tutorial

Now that the Windows 10 system is mature and most developers are developing under Windows 10, let me make a configuration of the Java environment variable in Windows 10:

Here's how:

JDK (select the appropriate JDK version):

JDK10.0.1

Http://www.oracle.com/technetwork/java/javase/downloads/jdk10-downloads-4416644.html

Jdk-9+181_windows-x64_ri

Http://jdk.java.net/java-se-ri/9

?

JDK 8u171,jdk 8u172

Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

?

I computer Windows 10 64-bit Select JDK 8u172, as shown;

Select the appropriate JDK version to download, after downloading, the JDK installation steps are as follows:

Select the downloaded JDK;

?

Double click, the following page appears, click Next;

?

If you need to change the path, click Change;

This is the choice of the JDK path;

?

This is the choice of the JRE path;

?

In the development of single-machine software based on Java console, the JDK usually needs to configure some environment variables to ensure the normal compilation and operation of the program. When the Java program runs, these environment variables tell the operating system where Java_home is, where the JDK provides the class library, and how to find the Java compilation Runtime environment. The JDK configuration involves three environment variables, namely:

The root directory of the ØJAVA_HOME:JDK.

ØCLASSPATH:JDK provides the class library, which is the jar file in the Java_home Lib directory.

Øpath: The environment variable must already be defined, you need to add the Java_home Bin directory after the value of the original variable.

Assuming the JDK's installation directory is C:\Program files\java\jdk1.8.0_172, the environment variable is configured as follows:

Java_home=c:\program files\java\jdk1.8.0_172

Classpath=.; C:\Program Files\java\jdk1.8.0_172\lib\tools.jar; C:\Program Files\java\jdk1.8.0_172\lib\dt.jar;

Or

Classpath=.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (including the beginning of ".") And the end of the ";" )

Path= value of the original variable; C:\ProgramFiles\Java\jdk1.8.0_172\bin; C:\Program Files\java\jdk1.8.0_172\jre\bin;

Or

Path= value of the original variable;%java_home%\bin;%java_home%\jre\bin;

Where the points in the CLASSPATH variable are "." Represents the current directory.

The first step, after installing the JDK good, you need to configure the environment variables, right-click My Computer, select the "Properties" menu, find the "Advanced system Settings" option, click;

?

?

In the second step, click the "Environment variables" button to pop up the following interface;

?

Click the "New" button in system variables to edit the following system variables;

?

The third step, the same way to create CLASSPATH environment variables and modify the system path variable, the result is as follows;

CLASSPATH

?

PATH

?

The fourth step, in the cmd command window, respectively, enter java;javac;java-version display as follows, indicating that the installation configuration is successful.

?

?

?

Important Notes

1. When modifying the system's PATH environment variable, do not delete the existing content, otherwise it will affect the use of some system functions.

2. The environment variable name "Java_home" and "CLASSPATH" should be capitalized in accordance with the specification.

Windows 7 Tutorials

First go to Baidu search "jdk download" Download the latest version of the JDK, and install, the installation directory does not have to change, the direct default is good, after downloading, double-click to open the installation, the JDK installation is complete, will then install the JRE package, (JRE and JDK is paired, not to download the JRE package separately), after all installation, Two folders will appear in the installation directory (JDK and JRE)

?

Once the installation is finished, open the previously configured environment variables and check the first step: java_home,java_home content is the JDK installation directory. The installation directory of the Small series is: C:\Program Files (x86) \java\jdk1.8.0_91, (note that the following do not take ";" number)

?

Next is the second step, check classpath, this is the call to check the jar package. %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (the variable value is preceded by a number and a semicolon, followed by a semicolon), or can be written as ".; %java_home%\lib ", the same effect.

?

The third step is to create a "PATH" variable name in the "User variable", the variable value is:%java_home%\bin; (The bin directory of the JDK, remember ";" in the back)

?

After three steps completed, click "Environment variables" after "OK" use the shortcut key "Ctrl+r" Pull Up "cmd" command line Input "Java javac java-version" If the following information appears, the configuration is successful, if still not, can only repeat the above operation, Re-configure it again.

?

?

?

Java environment Variable Configuration tutorial

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.