Switch between different versions of JDK in IDEA (if online methods are useless, you can come and have a look)

Switch between different versions of JDK in IDEA (if online methods are useless, you can come and have a look)

Background: The team leader gave me a code developed by eclipse. I imported it into IDEA. I have been developing with JDK1.8. After finishing the work, I found that the server environment is JDK1.7. Then I changed the JDK directly in the IDE to recompile. Unexpectedly, the road was bumpy.
**

Please see the end

**

General methods online:

Step 1:
Select SDK and import the folder where the corresponding JDK is located.Insert picture description here

Step 2:
Select the jdk language standard used by the module by default
Insert picture description here

Step 3:
Import the native dependencies of the corresponding version of jdk
Insert picture description here
Step 4:
Set the default value of SDK
Insert picture description here

If it still doesn't work, step five appears again:

Insert picture description here

Anyway, I did it all, and I uninstalled jdk1.8, but it didn't happen, but it still prompted me that I could not compile.

Here comes the most important step

If you still can't get it through the above five steps, you can try this.

Insert picture description here

Try to remove this default option, anyway, I do this, and then it will work, and if you import multiple modules, each module jdk version is different, also remove this option.

Insert picture description here
For multiple modules, specify the version here and remove the first default option below.

I only solved the problem after seeing the blog of this old man
https://blog.csdn.net/dataiyangu/article/details/95621931

Guess you like

Origin blog.csdn.net/zhuyin6553/article/details/108483325