Selecting the JDK version the IDE will run under

All the products on all the supported platforms already have 64-bit JetBrains Runtime 21 bundled and it will be used by default to run the IDE. If you need to change the runtime to a different version, see below. Please note that all the current IDE versions require at least Java 17 version to run. Our IDEs will not run on the older Java versions like Java 8 or 11.

All platforms: download and install JetBrains Runtime via Choose Boot Java Runtime for the IDE action

  1. Start the IDE, use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Choose Boot Java Runtime for the IDE", press Enter.
  2. Select the version to install, the higher the number after b, the more recent is the version. It makes sense to install the most recent version or the version you were asked to try by JetBrains staff. Installing old runtime versions may render your IDE unusable or introduce new issues.
  3. Click the OK button and wait until the file with JetBrains Runtime is downloaded and configured.
  4. Restart the IDE to try the new runtime.
  5. Verify via About dialog that the new runtime is used. Notice the vendor (should be JetBrains s.r.o) and the release number (should correspond to the number after b in the file you've downloaded).
  6. If the JDK version in the About dialog doesn't match or didn't change, see below. Most likely, you have an environment variable configured which has the priority over the <product>.jdk file. Remove any environment variables affecting IDE runtime selection and restart.

All platforms: Add Custom Runtime

  1. Follow the steps from the section above to open the Choose Boot Java Runtime for the IDE dialog.
  2. Use the Add Custom Runtime option
  3. Select one of the already installed JDK 21 options or click Add JDK
  4. To add a new JDK specify the home folder of the Java 21 installation on your disk

This option is useful to check if the issue you might have is specific to JetBrains Runtime or is common to this Java version from all the vendors. It helps to isolate and fix issues with JetBrains Runtime or workaround problems as you can continue working until the issue is resolved.

All platforms: Switch back to the default bundled JetBrains Runtime

  1. Open the Choose Boot Java Runtime for the IDE dialog as described above
  2. Click the Use Default Runtime button
  3. Restart the IDE

If you can't start the IDE to access this dialog or the runtime doesn't change, please see below for the platform specific instructions. You would need to remove the <product>.jdk file from the configuration directory and unset any environment variables that override the default runtime. If there is no jbr subdirectory in the IDE installation directory, reinstall the product.

 

Windows

JDK (JetBrains Runtime) is bundled with all the product installers and it's recommended that you will use the provided JDK version unless there are any specific issues. Since 2017.1 version 64-bit JDK is bundled by default on all the systems.

<product>64.exe uses this JDK search sequence:

  1. IDEA_JDK / PHPSTORM_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK / CL_JDK / DATAGRIP_JDK / GOLAND_JDK environment variable
  2. idea.config.path\<product>64.exe.jdk file
  3. ..\jbr directory
  4. system Registry
  5. JDK_HOME environment variable
  6. JAVA_HOME environment variable

It’s also possible to start the IDE with <product>.bat file located in the bin directory, it uses the following JDK search sequence:

  1. IDEA_JDK / PHPSTORM_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK / CL_JDK / DATAGRIP_JDK / GOLAND_JDK environment variable (depends on the product)
  2. idea.config.path\<product>64.exe.jdk file
  3. idea.config.path\<product>.exe.jdk file
  4. ..\jbr directory
  5. JDK_HOME environment variable
  6. JAVA_HOME environment variable
Environment variable must point to the JDK installation HOME directory, for example:
c:\Program Files\Java\jdk17.0.10
  • The actual JDK version used by the IDE can be verified in Help | About dialog (open any project to access the menu).
  • Define IDEA_JDK / PHPSTORM_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK / CL_JDK / DATAGRIP_JDK / GOLAND_JDK variable depending on the product to override the default version from IDE_HOME\jbr.
  • Use Rapid Environment Editor to add/edit the variables, it will detect incorrect paths.

Linux

  • Starting from IntelliJ IDEA 2016 and the most recent versions of the lightweight IDEs, we are bundling custom JRE (JetBrains Runtime) with Linux distributions, just like we've been doing for Mac. Our custom JRE is based on OpenJDK and includes the most up to date fixes to provide better user experience on Linux (like font rendering improvements and HiDPI support).
  • Boot JDK path is stored in the <product>.jdk file located in the config folder. It can be modified either via the Change IDE boot JDK action or by manually editing .jdk file (if you can't start the IDE to change it via an action).
  • It's recommended to use the bundled JRE (if available). In case you have any issues with the bundled version, you can switch to the latest Oracle JDK or OpenJDK build available on your system (JDK 21 is recommended).
  • Check bin/<product>.sh file for the JDK search order, it's similar to Windows in terms of the environment variable names. It's a legacy way to adjust the boot jdk, use it for older product versions. Consider using <product>.jdk file instead (see above), so that your modifications can survive IDE updates/re-installation.
  • Check this answer if you need to install the JDK manually on Linux.
  • If you have problems with ugly fonts, please see this thread comments for the tips.
  • Help | About will show the actual JDK version.

macOS

  • IDE is using the bundled JetBrains Runtime by default.
  • If you override IDE JDK version (via the Choose Runtime plug-in), its path is stored in <product>.jdk file located in the config folder (idea.jdk for IntelliJ IDEA, pycharm.jdk for PyCharm, etc). Delete this file or change the path inside the file manually in case IDE no longer starts and you can't change it via the menu.
  • If IDE doesn't start and this file doesn't exist, create it manually and specify Java path to use (Java home location), for example:
    /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home
188 out of 489 found this helpful
208 comments

I have a Gradle Project. And my local Sandbox AppCode IDE does not run under JB SDK environment.

I went through the steps in this doc, and it did not really help.

The following suggestion did not work for me either because I have a Gradle Project:
https://stackoverflow.com/questions/55783215/intellij-plugin-development-freezes-target-intellij-instance/55783247

Also, as mentioned in the following link, my Gradle project did not fetch and use JB Runtime by default.
https://www.jetbrains.org/intellij/sdk/docs/basics/ide_development_instance.html#setting-a-jetbrains-runtime-for-gradle-based-plugin-projects

And I don't see JB JDK as an option under "Internal Java Platform". As suggested in another topic: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360002667799/comments/360000331139

Also tried putting `appcode.jdk` file with correct JB JDK path to build/sandbox config folder as well cache/sandbox.

Nothing works. Sandbox IDE keeps looking into the default JRE and keeps freezing in a minute after its launch. Exactly the behavior described at the stackoverflow link posted above.

0

Hi Dmytro.

This article is about setting JRE for real IDE, not for sandbox-IDEA.

If you're using gradle-intellij-plugin, make sure you're using the latest version of the plugin and see `jbrVersion` option in `runIde` task. More details here: https://github.com/jetbrains/gradle-intellij-plugin#running-dsl

The documentation about plugins development you can find here: http://www.jetbrains.org/intellij/sdk/docs/welcome.html

1

Thank you Alexander! Yeah, sorry about a slight off-topic. Was getting a bit desperate.

I did miss `jbrVersion` from the doc, thanks for pointing it out. It worked like a charm!

runIde {
jbrVersion = 'jbrex8u152b1402.1'
}
0

Start the IDE, use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Switch Boot JDK", press Enter.

0

Guys, how can I use bundled OpenJDK for WebStorm (I need legatures) and system JDK for scripts and internal terminal?

I can not build Cordova apps and use package.json tasks when OpenJDK installed, because in internal terminal java links to bundled JDK :(. JAVA_HOME and PATH configured correctly.

Requirements check failed for JDK 8 ('1.8.*')! Detected version: 11.0.3
Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.
[ERROR] An error occurred while running subprocess cordova.

Edited by Roman Sergeev
0

@Nm666, please vote for https://youtrack.jetbrains.com/issue/IDEA-218032 to be notified on any progress with it

0

@Elena Pogorelova Thanks! Done.

0

Hi, need some help. I'm trying to install PyCharm 2019 on ubuntu 18 to upgrade PyCharm 2017 I am working with now. So I've downloaded the tar file, extracted it and tried to run pycharm.sh which has failed - the image of gui starting has shown, but then the process has exited. Searching for help I've got the impression that this may be related to the jdk version. Now, it looks like this article should be an instruction on how to use the right jdk, but I've got totally lost: using JB SDK Bintray Downloader requires the PyCharm being already running, which is not the case, there is no pycharm.jdk file in the specified location, I have no mentioned preconfigured environment variables, etc. So, what should I do to start the PyCharm properly? Thanks!

0

@Michael Ry

> Selected location is stored inside the idea.config.path\<product>.jdk file, should you need to revert to the default behavior in case of any problem (like when IDE no longer starts), delete this file or modify the installation path inside.

>     product>64.exe uses this JDK search sequence:

  1. IDEA_JDK_64 / PHPSTORM_JDK_64 / WEBIDE_JDK_64 / PYCHARM_JDK_64 / RUBYMINE_JDK_64 / CL_JDK_64 / DATAGRIP_JDK_64 / GOLAND_JDK_64 environment variable
  2. idea.config.path\<product>64.jdk file
  3. ..\jre64 directory
  4. system Registry
  5. JDK_HOME environment variable
  6. JAVA_HOME environment variable
0

Michael Ry, please file a ticket to support with the error you get when running from the terminal. If there are any logs or crash dumps, please attach them as well.

0

Serge Baranov, will do it, thanks.

0

The Title "Selecting the JDK version the IDE will run under" sounds ambiguous, therefore I have two questions:

  1. Does IntelliJ use one JDK version to run itself
    and then can use a different JDK version to run and debug a loaded Java Project?

  2. If the answer to question 1 is yes:
    What does this Article talk about?:
    a) Installing a JDK Version to run IntelliJ itself
    b) Installing a JDK Version to run and debug a loaded Java project
    c) for both a) and b)

 

Thanks a lot!, kind regards,
Thomas

 

0

I have installed "Choose Runtime" plugin but when I run "Choose Runtime" from Help -> Find Action (Ctrl+Shift+A) the dialog "Loading Runtime List" shows nothing and then disappears:

What could be wrong?

I'm using IntelliJ IDEA 2019.2.3 (Ultimate Edition) Build #IU-192.6817.14 - Runtime version: 11.0.4+10-b304.69 amd64 on Ubuntu 18.04.3 LTS.

0

Please check the logs for exceptions: Help | Compress Logs and Show in ... We'd appreciate a bug report at https://github.com/denis-fokin/ChooseRuntime/issues .

0

I tried to open runtime list by Ctrl + Shift + A and "Choose runtime", however after few seconds of loading nothing shows up.
I can see only below image but then nothing happens.
Could you please assist?



I have: IntelliJ IDEA 2019.1 (Ultimate Edition)
Build #IU-191.6183.87, built on March 27, 2019
OS: Ubuntu 18.04

Edited by Kubix007
0

Please see my answer above for the same problem. We'd appreciate the logs/thread dumps.

0

Thank you. It looks like the plug-in needs Java 11 to run while IDE runs on Java 8 right now. We'll update the plug-in so that it works on Java 8 too.

0

Could you please let me know once it's done?

0

After choosing "jbrsdk-11_0_4-osx-x64-b494.1" version in "IntelliJIdea2019.1", IDEA was not able to launch. Thanks to the last section in the article, I found out where to look if IDE doesn't start. The problem was that "idea.jdk" file contained invalid path to JDK home. The path was:

/Users/<username>/Library/Preferences/IntelliJIdea2019.1/jdks/jbrsdk-11_0_4-osx-x64-b494.1/jbrsdk

while the correct path to JDK home on MacOS must look like

/Users/<username>/Library/Preferences/IntelliJIdea2019.1/jdks/jbrsdk-11_0_4-osx-x64-b494.1/jbrsdk/Contents/Home

Most probably, "Choose Runtime" plugin has a defect, that leads to an incorrect Java home path being written to the config file, while the contents of the archive are correct and work fine on MacOS.

0

@Serge Baranov @Kubix007 Updating "Choose Runtime" plugin from 1.0.3. to 1.0.7 does the trick for me. Now I can see the runtime list.

0

Hi, I've installed 'Choose Runtime' plugin on Android Studio 3.5
Plugin's dialog wasn't downloading/installing JB version of jdk, so I've selected installed via brew openjdk11 to see whether it will work.
Studio launches, but hangs on 99%, no errors or something. How can I revert 'Choose Plugin' selection without running studio?

0

Delete idea.jdk file from the config directory as described in this document.

1

New box, fresh install of JDK 8 (Oracle) and IJ. IJ loads fine but a small app that requires Oracle JDK 8 keeps throwing an error: Runtime 11 required. I have set the JDK in at least three places without any success (to JDK 8, bytecode version 8, module setting 8, project setting 8).

As I understand this article only pertains to running of IJ itself but it is somehow causing an issue with this small app. I will try again tomorrow and then open a ticket if necessary.

 

 

 

0

Hello. I have configured IDE on java 11 version(Environment Variable has 11 version, in IDE Project Structure - SDKs has 11 version, Module - Language level has 11 version, Java Compiler - Pre-module bytecode version has 11 version, Run/Debug Configuration has 11 version), but I got UnsupportedClassVersionError: myClass has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0. 

I learn several the same type issues:

https://stackoverflow.com/questions/12900373/idea-javac-source-release-1-7-requires-target-release-1-7/12900859#12900859

https://stackoverflow.com/questions/58125830/has-been-compiled-by-a-more-recent-version-of-the-java-runtime-class-file-versi

I did my configuration like links above, but I still get this error.

How can I fix it? Tell me please.

0

Please submit a ticket at https://intellij-support.jetbrains.com/hc/requests/new and attach a sample project to reproduce the issue.

0

I'm unable to start Pycharm (version 10.0.2) after updating my OSX to Catalina because of the "PyCharm was unable to find a valid JVM". It redirects me to installing a deprecated version of Java on Apple support (Java for OSX 20117-001), but the deprecated version can't be installed since a newer version exists on the disk. I'm hesitant to use a deprecated version so I'm wondering if it's an issue with the path.

Since I can't seem to get it opened, I read the last section here, and don't think pycharm.jdk exists in `~/Library/Preferences/PyCharm40 folder` that I have. Since I'm new to all of this, I'm unsure how to create a pycharm.jdk file and where to adjust the path. I was wondering if the path does indeed to be changed or if there's a bug where the deprecated version of Java needs to be installed.

0

Please update to the latest PyCharm version. The one you have doesn't support current macOS version.

0

Please sign in to leave a comment.

Have more questions?

Submit a request