JDK installation steps in Windows environment

1. Download

1. Open the official website, select Oracle JDK, and click "JDK Download"

Official website address: http://www.oracle.com/technetwork/java/javase/downloads

2. Select the JDK installation package

3. Tick to agree to "Oracle Technology Network License Agreement" and click "Download"

4. Log in to the Oracle account to download the JDK 

 

Two, installation

1. JDK and JRE installation

JDK: java development kit

JRE: java operating environment

(1) Double-click directly to run the downloaded jdk-8u241-windows-x64.exe installation package

(2) Click "Next" directly

(3) Select the installation location and click "Next" (preferably choose the default path)

(4) JDK is being installed

(5) Install JRE (the installation path is best to choose the default path), click "Next"

(6) JRE is being installed

(7) After the installation is complete, click "Close"

 

2. Java environment variable configuration

(1) Right-click My Computer on the computer desktop—>Properties—>Advanced System Settings—>Environment Variables—>System Variables

New variable name: JAVA_HOME

Variable value: C:\Program Files\Java\jdk1.8.0_241

(Note: the name of jdk at the end of the variable value is the name of the downloaded jdk installation package)

 

(2) Open Path, edit environment variables, add %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin

 

(3) Right-click My Computer on the computer desktop—>Properties—>Advanced System Settings—>Environment Variables—>System Variables

New variable name: CLASSPATH

Variable value: .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar

(4) Open Path, edit environment variables, and add C:\Program Files\Java\jdk1.8.0

 

备注说明:

a、.表示当前路径,%JAVA_HOME%就是引用前面指定的JAVA_HOME;
b、JAVA_HOME指明JDK安装路径,此路径下包括lib,bin,jre等文件夹,tomacat,eclipse等的运行都需要依靠此变量;
c、Path使得系统可以在任何路径下识别java命令;
d、CLASSPATH为java加载类(class or lib)路径,只有在classpath中,java命令才能识别;
e、在Path中添加jdk\bin的绝对路径的目的是解决在cmd窗口中输入javac时,提示java环境变量的配置 javac不是内部或外部命令的问题。

3. Verify that the JDK is successfully installed

(1) Press the Windows+R keys on the keyboard at the same time to open the run window, enter cmd in the window, and click OK

(2) Enter java-version or javac in the cmd window. If the version information appears, it indicates that the JDK installation and configuration are successful

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/weixin_43184774/article/details/106140147