JAVA installation and environment configuration (2022)


1. Java download

Not much nonsense, go directly to the official website to download

Java Downloads | Oracle




Two, Java installation steps

1. Open the official website, you can see the following interface, the top one is the latest version of java, we can find the version we need on this page to download. Generally choose java8.

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

 2. Scroll down and you can see that there are other versions, Java 16, Java 11, Java 8 (Since the release of Java, by September 2021, Java has launched the latest Java17, and each upgrade has added different Features. But the new version is not necessarily the best version, Java will launch a "long-term technical support version" (LTS for short) every three years, Java 8 is an LTS, the next one is Java 11, and now Java17 Also LTS), choose Java 8 here .

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

 3. Select the computer operating system and the download link corresponding to the number of digits to download, here is 64-bit , windows10, so choose x64 Installer .

 watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

 4. Click the link, the pop-up window below will appear, let’s check it and continue .

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

 20210918184621741.png

 Note: Clicking on the download link may lead to a page that needs to log in to the oracle account. If not, you need to register

5. After downloading, click the downloaded file to install

Note: The location of the file is the default location downloaded by the browser

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

 Just click "Next" here

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

Finally, click Close to open the installation directory, and you can see jdk and jre, which means that the java installation is successful

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

You can test it: use the shortcut key "Windows+R", enter "cmd" to enter the command window, and enter the code "java -version" to check the version of java on the computer. If you enter "javac -version", an exception will occur, indicating that The computer cannot recognize this command, and we need to configure it later.

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_17,color_FFFFFF,t_70,g_se,x_16



Four. Java configuration

Java has been installed. In order to use the " javac " command to execute the .class file, you need to change environment variable (if you don't change it, you must open the command window in the file directory where jdk is located every time to run it. After the change, you can Direct shortcut key "Win+R", enter the cmd command and use the "javac" command)

1. Right-click My Computer -> Properties, open the Control Panel, click Advanced System Settings, and select Environment Variables

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_18,color_FFFFFF,t_70,g_se,x_16

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

2. You can see that there are user variables and system variables, and we will modify them in the system variables next

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

3. Click New at the bottom of the system variable table , and enter the variable name and variable value in the figure below. Note: The variable value is the location of the file directory where you downloaded jdk

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

4. In the system variables, find the variable Path, double-click Path, create a new one, enter : %JAVA_HOME%in;%JAVA_HOME%jrein

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16

Finally, click OK and test it: "Win+R" input "cmd" to open the command window, input "javac" will not report an exception, so far, the installation and configuration of Java is complete, if you have encountered If you have any questions, please leave a message below.

watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBA5bm45pyJ5oiR5p2l5bGx5pyq5a2k44GG,size_20,color_FFFFFF,t_70,g_se,x_16 

 


 

Guess you like

Origin blog.csdn.net/HouGOD/article/details/122802507