1. Java download
Not much nonsense, go directly to the official website to download
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.
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 .
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 .
4. Click the link, the pop-up window below will appear, let’s check it and continue .
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
Just click "Next" here
Finally, click Close to open the installation directory, and you can see jdk and jre, which means that the java installation is successful
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.
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
2. You can see that there are user variables and system variables, and we will modify them in the system variables next
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
4. In the system variables, find the variable Path, double-click Path, create a new one, enter : %JAVA_HOME%in;%JAVA_HOME%jrein
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.