## JDK installation and configuration environment variable

JDK installation and configuration environment variable

Installation of Windows10 system

Before installing, we need to go to the official website to download an installation package jdk

I downloaded this version is jdk1.8.00

1. Install JDK installation directory selected during the installation process will be twice the installation prompts. The first is to install jdk, the second is to install jre. It recommended that two different files are installed in the same folder java folder. (Can not be installed in the root folder of java, jdk and jre installed in the same folder to be wrong)

1: jdk installation directory chosen at random just before the default installation directory \ java directory can be modified

2: Install the jre → Change → \ java directory before same and can be installed jdk directory

Note: If there is no installation directory requirements, can be all the default settings. No need to make any changes, two were directly click Next.

2, configure the environment variables:

For Java developers, the main two commands will use the JDK: javac.exe, java.exe. Path: C: \ Java \ jdk 1.7.0 _09 \ bin. However, these command windows because they do not belong to their own command, so if you want to use, you need to configure the path. 

Click "Computer - Properties - Advanced System Settings", click "environment variables." Under "System Variables" toolbar, click "New" to create a new system environment variables.

50aa00df-6bb9-471c-81a7-363845b6f2b3

(1) New -> variable name "JAVA_HOME", variable value "C: \ Java \ jdk1.8.0_05" ( ie JDK installation) 
(2) Edit -> variable name "Path", the last of the original face value of the variable plus ";% JAVA_HOME% \ bin;% JAVA_HOME% \ jre \ bin" 
(3) New -> variable name "CLASSPATH", variable value ";% JAVA_HOME% \ lib; % JAVA_HOME% \ lib \ dt.jar. ;% JAVA_HOME% \ lib \ tools.jar "

 

Such as: operating the JAVA_HOME environment variable is as follows:

23f073bb-cc49-43c1-8da1-099f9c18dda3 [3]

01747df9-c309-438d-a6f7-ea68f43c416c [1]

3, identification of environmental configuration is true:

Input java, javac, java -version console command respectively, the JDK compiler information shown below, including modifying the command syntax and parameter information options, occur.

java command:

3aa10479-a799-4805-b97f-c99c9f4c698c [1]

08c7092a-0487-46c1-9d45-024867dfc5e2 [4]

javac command:

6fa0a9a4-77f6-413f-bbdc-9f7afe093061 [4]

java -version command:

c458fc01-02e6-4c27-b5bb-3fce15202360[4]

4, the first java program verification in console:

public class Test {
    public static void main(String[] args) {    
    System.out.println("Hello Java");
    }
}
Hello java

In this way, no problem, we can start doing normal things!

Guess you like

Origin www.cnblogs.com/liurui-bk517/p/11010218.html