Five, JDK version settings in eclipse
-
1. Click Window --> Preferences: Click> in front of Java, and then click Compiler
-
Select the compiled version in the drop-down box behind JDK Compliance on the right. Note that the compiled version is consistent with the running version, and click Apply after setting.
-
2. Click Window --> Preferences: Click> in front of Java, and then click Installed JREs
-
Click Add to pop up the Add JRE operation box, select Standart VM, and then click Next, as shown below:
-
After clicking Next, click Directory and select the installation path of JDK/JRE on your computer:
-
After clicking to select the folder, click Finish, the specified JDK will be added to the blank of Installed JREs, and the check mark in front of the newly added JDK will be checked.
6. Adjust the JDK version of existing projects
-
Click on JRE System Library in the project --> right click Build Path --> Configure Build Path
-
Click Configure Build Path to pop up a box: select Libraries, then Add Library --> JRE System Library --> Next
-
After clicking Next, you can select the JDK version according to the following operations, and finally click Finish.
-
Remove redundant JRE to prevent version conflicts: select the JRE System Library to be removed —> Remove, and finally click Apply --> Apply Close