win10 jdk1.8 installation and configuration environment

1. Download jdk1.8

2. Install

  1. Open the installation package for installation, click Next
    image
  2. Select the installation path, click Next
    image
  3. installing. . .
    image
  4. Next will jump jre installation interface
    image
  5. In fact, do not install jre also possible, including because jdk jre, you can exit the installation directly.
    Explained in detail with reference to https://www.cnblogs.com/gaigaichen/p/6262872.html
  6. Next Dafa direct installation, the installation is successful
    image

3. Set Environment Variables

Generally need to configure three variables: Java_Home, Path, Classpath

  1. Right-click My Computer → click Properties, then click Advanced System Settings.
    image
  1. Click Environment Variables
    image
  2. User variables only works for the current user, the system variable is for all users.
    image
  3. Variables Description (variable names are not case-sensitive)
    1. JAVA_HOME: jdk represents the installation directory. Easy to modify jdk path, but also some third-party software editors agreed jdk installation path variable name.
    1. Path (original system): When the system is required to run a program, the system and specify the directory to find the next path in the current directory. The following variable specifies the directory needed java compiler program running.
    1. ClassPath: class search path is specified, the use of already written to the class, JVM is through it to find the class. After jdk1.5, no need to configure classpath, jdk automatically search the current directory, dt.jar and tool.jar.
  1. Configuration environment variable
    click New, enter the variable name and value, and then OK.
    image
    Modify the Path variable: Find the Path entry click Edit, add the following two values, and then OK.
%JAVA_HOME%\bin
%JAVA_HOME%\jre\bin

Since win7 is displayed in a row, each separated by semicolons paste in the line.
image
Because it is jdk1.8 version, CLASSPATH do not have to configure, but in some books and tutorials have this configuration, the configuration done no effect. Names and values as shown in FIG.
image

.;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;

Note that there is a point in front.

4. Test

Command line to run java, javac, java -version to see the effect

javac

image

java -version

image

java

image

5. Installation configuration

Guess you like

Origin www.cnblogs.com/xhdt/p/12395517.html
Recommended