Problem while setting the Jdk path.


I want to use the IDEA jdk path to while creating a project programmatically. I am using ProjectJdk[] jdks = ProjectJdkTable.getInstance().getAllJdks();
But this returns a null aray since no jdk path is set.
I want to set the path to IDEA Jdk. How can I do this programmatically?

I tried using ProjectJdkTable.getInstance().getInternalJdk(), but this returns JavaSdk and if I use this as my project jdk and open the project, java files in that project don't compile. Error is shown, jdk path not set.

IDEA jdk has its path as IDEA_HOME directory whereas JavaSdk has its path as IDEA_HOME/jre.

Am I missing something? Can someone provide me with more pointers on this?


Please sign in to leave a comment.