Cannot remove configured SDKs
I am about to go crazy here.
I've got many different versions of Java listed in my SDKs: 1.8, 11, 12, 13, 16, and 16 (2). I've tried to remove all except 1.8 and 16 but even after clicking Apply then Save and restarting IDEA to find that they are still gone, they show up again not long after.
The SDKs do not even exist on disk. Where is it getting the information from to re-import them? I tried deleting the IntelliJIdea2021.1 folder in %appdata%\Jetbrains and %localappdata%\Jetbrains, and the folder just comes back with no settings lost. When I close and re-open IDEA, the project I was working on is opened again.
There are no old config folders in my c:\users directory that it could be importing from. I also removed all the old configs from the two settings folders in %appdata% and %localappdata%.
请先登录再写评论。
Check the c:\Users\<user>\AppData\Roaming\JetBrains\IntelliJIdea2021.1\options\jdk.table.xml file.
I did find that file and tried to modify it. When I loaded up IntelliJ, the SDKs were gone, but they still get duplicated automatically. I have no idea if this related to Gradle, but it seems to happen after I refresh my Gradle project.
FWIW, it seems that the jbr-11 gets automatically imported as well. I did not do this myself.
Please add autodetect.all.jdks=false in Help | Edit Custom Properties and restart the IDE.
That did not work either. I'm going to file a ticket because I think this is a bug with the gradle integration. The JDKs don't get added when I build the project through IDEA, but only when I reload the gradle project.
Do you have any additional plugins installed in the IDE?
What project are you opening? (e.g. what is the build system: maven, Gradle, .idea? Is it open source so we could try that too?)
The issue could be happening because of a plugin or a project or both. Could you please try clearing all SDKs and checking that in a newly created java project from the IDE project wizard. Do the unneeded SDKs appear again?
I was having the same issue. I found how to remove unknown jdks here:
https://www.jetbrains.com/help/idea/sdk.html