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
- 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.
- 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.
- Click the OK button and wait until the file with JetBrains Runtime is downloaded and configured.
- Restart the IDE to try the new runtime.
- 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).
- 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
- Follow the steps from the section above to open the Choose Boot Java Runtime for the IDE dialog.
- Use the Add Custom Runtime option
- Select one of the already installed JDK 21 options or click Add JDK
- 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
- Open the Choose Boot Java Runtime for the IDE dialog as described above
- Click the Use Default Runtime button
- 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:
- IDEA_JDK / PHPSTORM_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK / CL_JDK / DATAGRIP_JDK / GOLAND_JDK environment variable
- idea.config.path\<product>64.exe.jdk file
- ..\jbr directory
- system Registry
- JDK_HOME environment variable
- 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:
- IDEA_JDK / PHPSTORM_JDK / WEBIDE_JDK / PYCHARM_JDK / RUBYMINE_JDK / CL_JDK / DATAGRIP_JDK / GOLAND_JDK environment variable (depends on the product)
- idea.config.path\<product>64.exe.jdk file
- idea.config.path\<product>.exe.jdk file
- ..\jbr directory
- JDK_HOME environment variable
- JAVA_HOME environment variable
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
Please sign in to leave a comment.
No, you are mixing up the location of the JDK itself and the location of the text .jdk file that overrides the default JDK.
My installation of IntelliJ IDEA Community Edition 2017.2.5 in Linux does not have the idea.jdk file in ~/.IdeaIC2017.2 this page is talking about.
Delete idea.jdk file from the config directory as described in this document.
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
Delete idea.jdk file from the config directory as described in this document.
This plug-in is needed when you were instructed by the support team or by the developers to use some specific runtime version in order to try some fix or a workaround for a problem. In all the other cases you should not override the runtime and use the default one that is bundled with the product.
Your usability concerns are valid and I've reported the same to the responsible developer long time ago. In any case, the plug-in is open source and you are welcome to contribute if you are interested: https://github.com/denis-fokin/ChooseRuntime .
Please help. I've installed IDEA 2020.3 and all of my gradle 2.x projects are broken. This article's workaround (set IDE to use JDK 8) worked with 2020.2. However with 2020.3, when I perform the steps outlined in this article, IntelliJ fails to start with the error that JDK 11 is required.
Is IDEA 2020.3 no longer capable of running under JDK 8??
Is this article no longer valid?
Thanks.
I'm running macOS 12 latest beta (21A5506j). None of the JetBrains apps open, they all refuse to open with no warning if launched from the GUI. If I run them from the terminal, I see that the JetBrains Java Runtime is crashing with the error I include at the end of the comment.
Trying to change the JRE used by this method doesn't seem to change anything. Is there anything I can do to fix this?
Try try workaround from JBR-3715 mac os 12 beta6 Unable to start IDEA.
Add the following VM options:
That worked, thank you!
How can I run Idea 12 with the default Java 6 VM and target code and binaries to Java 7?
On Mac OS X 10.8.4
Project/module SDK and byte code level doesn't depend on the JDK IDEA runs under. JDK is configured for the project/module in the File | Project Structure, refer to help for details.
http://www.jetbrains.com/idea/webhelp/configuring-global-project-and-module-sdks.html
http://www.jetbrains.com/idea/webhelp/compiler-java-compiler.html
Serge: did you make a typo for the "JAVA_HOME" env var?
Note under your Windows section that the first 2 occurrences (the first two 5. items) use "JAVA HOME" (no underscore, whereas the last one (the third 4. item) uses "JAVA_HOME" (with an underscore).
"JAVA_HOME" (with an underscore) is THE universal convention, to my knowledge. I have never seen "JAVA HOME" before, indeed, I think that that space may cause all kinds of problems.
Please confirm what is going on, and correct your original posting if needed.
Thanks, I've fixed the typo.
Can I change the jdk used for database connections without changing the ide jdk version?
Stephen, why do you need to change the JDK version for the database connections? It's not possible at the moment, IDE JDK is always used.
On OSx you can define environment variables in /etc/launcd.conf (create the file if it does not exist).
The variables defined in launchd.conf will be available in Terminal and for all other processes. The downside is that changes to the file are not picked up before restarting your system.
But if you just want to set IDEA_JDK once to 1.7 (instead of changing Info.plist in every EAP install you download) it is a pretty good solution - since it allows you to launch Intellij any way you want.
Doh - spelled the file name wrong - the correct name is "/etc/launchd.conf".
If you want to do this the hard way, see
http://codepulsive.blogspot.com.au/2013/05/using-environmentplist-with-mountain.html
and
http://codepulsive.blogspot.com.au/2013/05/setting-environment-variables-in-os-x.html
It's the way I keep my shell and GUI environment variables synchronised. Before ML it was easier, using environment.plist, but ML broke that. The ML solution still works with Mavericks.
An easier way, that maintains synchronisation of .profile and desktop environments.
http://codepulsive.blogspot.com.au/2013/11/setting-environment-variables-in-os-x.html
12C seems to be completely broken for La Clojure under Mavericks. I have a small clojure test project that hangs 12C when I try to open it. I have to force close.
It's broader than that for me. 12C seems to hang at the 'scanning files" stage on most projects. Nasty. Thank you Apple for the constant API changes. Is there any information I can forward? It seems that you know the way out of this, but it is just going to take some time.
Please report bugs to the issue tracker and attach thread dumps/ logs when it hangs.
I've reported the bug: IDEA-116177. In the meantime, though, I seem to have found a fix for it. I uninstalled the new Wacom Intuous 3 drivers I installed after upgrading to Mavericks. This may be useful information for others.
Still hanging if I set IDEA_JDK to Java 7. On this display, I would say that Mavericks is a disgrace to its developers. It is Java-hostile to an advanced degree.
hello, I installed webstorm7 and pycharm3.02 in the same time, my os is mavericks. then i change both product files in /Applications/<Product>.app/Contents/Info.plist to jvm 1.7,
and then webstorm started successfully,but pycharm still need jdk6 to start . why?
Li Acerphoenix, most likely WebStorm 7 has a more recent java launcher stub version that doesn't require JDK 1.6 to run, PyCharm 3.0.2 is built from the older platform version which still requires JDK 1.6 to be present, even if you are running under JDK 1.7. This will be resolved in the future updates.
After editing the plist, make sure to resign the app bundle to avoid a nagging prompt and intermittent hangs at startup. Create a code-signing cert, and then run:
sudo codesign --verbose --force --sign "<CERT COMMON NAME>" /Applications/WebStorm.app/
I verified this with Webstorm 7.0.3 on OS X Mavericks 10.9.2.
The IDEA_JDK variable doesn't work on Mac OSX. But it will in will in IDEA v14: http://youtrack.jetbrains.com/issue/IDEA-123552#comment=27-739506