How do I get default/pre-installed Java SDK for setting as the project SDK programatically?
Answered
In short what do I pass for
ProjectRootManager.getInstance(project).setProjectSdk(Sdk)
Please sign in to leave a comment.
Related to this question, am I right in thinking that recent versions of IntelliJ automatically set up an SDK for projects to use from the bundled JRE?
No, Java Runtime Environment cannot be set as a Java Development Kit.
Yes, it can, as long as it includes tools.jar (which the bundled one does).
I ask because in my plugin I actually create an SDK automatically from the bundled JB runtime if the user has no SDK configured, but it seems like that might be redundant in recent IntelliJ versions since it seems that IntelliJ also does that. I just wanted to confirm that I can remove that functionality from my plugin.
Answered by Yann Cebron on slack for future reference