Install JDK1.8 under Windows11

1. Download the JDK1.8 installation package

You can download the JDK1.8 installation package from the official website. I downloaded jdk-8u45-windows-x64.exe

 Two, install JDK1.8

1. Click the exe installation package

 

 2. Click Next, click Change to modify the path in this step

 Note: For the convenience of installation, it is recommended that you create a new file directory with the following style in your installation directory

 3. Click Next to proceed with the installation. The installation process takes a long time and takes a while.

 4. A box will pop up during the installation process (this is the package installed in the JRE folder, if you are careful, you will find that there is already a package exactly the same as this JRE in the JDK folder, we will install this in the The jre directory of the newly created directory will do)

 5. After modifying the directory, click Next to install

 6. The installation is complete

 3. Configure environment variables

 1. Right click on This PC and select Properties

2. Select Advanced System Settings

 3. Select environment variables

Note: You can also search for "environment variables" in the search box of Windows 11, and choose to edit the system environment variables 

 4. Click New in System Variables

 5. Create a new JAVA_HOME variable and click OK

变量名: JAVA_HOME
变量值: C:\softwore\JDK\jdk 
注意:找到之前下载的JDK安装文件夹下的bin目录,复制其路径,但是路径不带bin

 6. Find the Path variable under the system variable, click Edit, and then click to create a value in the path variable

7. Click New, and copy '' %JAVA_HOME%\bin " and " ;%JAVA_HOME%\jre\bin " to the two new items of the Path variable respectively. Note that there must be a semicolon in front of the second one.

%JAVA_HOME%\bin
;%JAVA_HOME%\jre\bin

8. After adding environment variables, click "OK" to close all windows, be sure to click OK, and close all windows one by one

Fourth, verify that the JDK is installed successfully

1. Win+R to open the dos command window, enter cmd, and click OK (Enter)

 2. Enter javac

3. Enter java -version (Note: java and - have blank lines)

 4. In this way, the installation is successful.

Guess you like

Origin blog.csdn.net/wd520521/article/details/129617129