Windows configure JDK1.8 environment variables

1. Install java first (the default installation path here is C:\Program Files\Java. Note that click on the java folder to confirm whether your jdk and jre have been successfully installed. You can also use the cmd command java to confirm that they are installed. which things.)
2. Double-click to open My Computer, right-click on the blank and select Properties, then select Advanced Properties Settings, and click Environment Variables (if there is no My Computer on win10, just click on a folder and there will be an option for this computer on the left. Click is mine computer).
3. Click New Variable in the System Variables column, the variable name is (JAVA_HOME), and the variable value is (C:\Program Files\Java\jdk1.8.0_91) Note that the two points "()" are for my example, so don't put them on , jdk1.8.0_91 is the version I installed, you should modify it to the version you installed and click on it according to the directory location.
4. Find the variable named (CLASSPATH) if there is no new one, add it directly, the value is ( .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar; ) in the brackets It is recommended to use Ctrl+c to copy directly.
5. Find the Path variable. If there is no new variable named Path, click Edit, click New Input Value (%JAVA_HOME%\bin), and then create a new value (%JAVA_HOME%\jre\bin). Or click Edit Text to add those two sentences at the end as well.
6. All the way to determine the end to the end.
7 In cmd, you can use the java command and javac command to test whether the installation is successful. If the configuration fails after such a detailed explanation, it is recommended not to learn java.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324488665&siteId=291194637