Launched IDE is Always Using Oracle JDK

Answered

Hello,

I am developing a simple plugin. When I launch my plugin in the the test IDE, many menu items do not work (both my simple "HelloWorld" menu item and default IntelliJ menu items). They simply do nothing when I click on them. Based on some reading, it sounds like this is caused by using the wrong JDK.

OK, cool. So I am trying to configured my launch settings to use the bundled JDK. However, no matter what I try, the launched SDK always uses the Oracle JDK. I have attached a screenshot. Top red box shows my plugin settings. The middle red box shows the JDK it decided to launch with. The bottom red box shows the warning to change JDKs. I've clicked on the "Switch" option (not shown below) and chosen the correct SDK, but whenever the IDE restarts, it doesn't seem to take.

Any ideas?

Thanks.

 

 

 

1
2 comments

Switching runtime via IDE will not have effect if IDE is not started with the launcher.

Change JRE in the Run/Debug configuration instead. Default you see there is the IntelliJ Platform Plugin SDK used for development, this SDK may use any JDK you've configured when adding it:

It is NOT using JetBrains Runtime by default.

You can download JetBrains Runtime at https://bintray.com/jetbrains/intellij-jdk/ and configure Plugin SDK to use it or configure the Run/Debug configuration JRE to use it.

1
Avatar
Permanently deleted user

Hi Serge, thanks for your comment. It helped guide me on the correct path. For those who run into this issue in the future, here are the steps I took:

 

  • Downloaded the Jetbrains JDK from: https://bintray.com/jetbrains/intellij-jdk/openjdk8-osx-x64/1343.2#files
  • Unzipped the contents to a folder
  • In IntelliJ, selected File->Project Structure -> SDKs.  Click "+" and "JDK" and add the directory of the JDK you unzipped above. Call it something like "1.8 Jetbrains"
  • For the IntelliJ Plugin SDK, select the internal SDK that you defined above (ex: "1.8 Jetbrains")
  • In the run configuration for your plugin, choose the JRE from the previous step.
  • When you run the plugin, verify that the console displays the correct path to the new JDK.

 

 

0

Please sign in to leave a comment.