Selecting the JDK version the IDE will run under

Java 8

Please be aware that Java 8 is required to run IntelliJ IDEA starting from version 2016 on all the supported platforms. It also applies to the lightweight IDEs based on IntelliJ platform released from the same branch (144+).

Java 11

Starting with 2019.1 version some products are already bundled with JetBrains Runtime version 11 or have the choice between 8 and 11 when downloading. Other products can be switched to JBR11 as described below.

All the products on all the supported platforms already have JetBrains Runtime bundled and it will be used by default. If you need to change the runtime to a different version, see below.

All platforms: download and install JetBrains Runtime via JB SDK Bintray Downloader plug-in

  1. Install the JB SDK Bintray Downloader plugin (screenshot).
  2. Start the IDE, use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Get JB SDK", press Enter.
  3. 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.
  4. Click the Download button and wait until the file with JetBrains Runtime is downloaded.
  5. Once download is finished, click the Install button, the file will be unpacked into idea.config.path\jdks location and the full path to this JDK will be saved into idea.config.path\<product>.jdk file, for example: C:\Users\serge\.IntelliJIdea2017.1\config\jdks\jbsdk8u152b819.1_windows_x64. IDE will automatically restart.
  6. 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).
  7. 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: switch between installed runtimes

  1. Start the IDE, use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Switch IDE Boot JDK", press Enter.
  2. Switch IDE Boot JDK dialog appears. Select the version from the drop-down or click "…" entry to specify the custom location. This location has to point to the JDK installation home directory (like c:\Program Files (x86)\Java\jdk1.8.0_112 or /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/ or /usr/lib/jvm/open-jdk).
  3. Please note that using JetBrains Runtime is highly recommended for performance and stability reasons (it fixes many known OpenJDK and Oracle JDK bugs).
  4. 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.

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 (32-bit JDK can be downloaded on Windows by the installer if needed).

JetBrains Runtime (based on OpenJDK) can be also downloaded separately, but you normally don't need to do it. 

<product>.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 (depends on the product, WEBIDE_JDK applies to both WebStorm and PhpStorm before version 2016.1)

  2. idea.config.path\<product>.jdk file
  3. ..\jre directory
  4. system Registry
  5. JDK_HOME environment variable
  6. JAVA_HOME environment variable

<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

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.jdk file
  3. idea.config.path\<product>.jdk file
  4. ..\jre64 directory
  5. ..\jre directory
  6. JDK_HOME environment variable
  7. JAVA_HOME environment variable
Environment variable must point to the JDK installation home directory, for example:
c:\Program Files (x86)\Java\jdk1.8.0_112
  • 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\jre.
  • 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 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 1.8 build available on your system (JDK 1.8 is recommended and older Java versions are not supported starting from IntelliJ IDEA 16).
  • 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.

Mac OS X

  • Our latest IDE versions come with the bundled custom JDK 8 which contains the fixes for most known OpenJDK and Oracle JDK bugs. Should you need to use a different Java version, please refer to this blog post.
  • If you override IDE JDK version, 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/jdk1.8.0_112.jdk
161 comments

@Leonidsahansky:

On the 32-bit Windows to change to some other Runtime for IntelliJ IDEA you set IDEA_JDK system environment variable with the value of the directory containing your Java 8 installation, for example:

IDEA_JDK=c:\Program Files (x86)\Java\jdk1.8.0_152

Now if you start idea.exe, it will use the specified JDK instead of JetBrains Runtime. Note that you may need to logout/login for the new environment variable to take effect.

0

The "JB SDK Bintray Downloader" is too old, the jdk it downloads it not working for current IDEAs ( 2018.x ), my idea can't start after using it.

My fixing is to download the latest jetbrains jdk, from <https://bintray.com/jetbrains/intellij-jdk/openjdk8-osx-x64/1293.1#files>, and do other process manually, and it's OK

0

Any plans to also provide a patched jdk 11?

I cannot evaluate Kotlin expressions in a java 11 project:

"Unable to compile for target level 11. Need to run IDEA on java version at least JDK_11, currently running on JDK_1_8"

Edited by Arvid Heise
0

Same as above.. When is the Stable Java11 release coming?

Currently when Idea is started with the latest early access version of Jdk11 i.e.  jbsdk11b125, a few things do not work.

 Example: Quick fix to import usage of a type does not work

0

Please report IntelliJ IDEA 2019.1 + JetBrains Runtime 11 issues at https://youtrack.jetbrains.com/issues/IDEA. It's work in progress. We'll release IntelliJ IDEA 2019.1 with 2 download options: JetBrains Runtime 8 and JetBrains Runtime 11. You'll be able to choose which one works better for you. Once all the major issues are resolved version 11 runtime will become the default.

0

Thanks for the reply @Serge

I tried this on 2018.3.4 and logged a bug - https://youtrack.jetbrains.com/issue/IDEA-207338

I will try with 2019.1. -> Tried in 2019.1 as well. It does not work.

Edited by Vicky D
0

@Serge

Another quick questions: One there is stable jbsdk or jbre version of Java 11, can IntelliJ Idea 2018.3 be run under that? or will it be only compatible with IJ 2019

0

The fixes specific to JetBrains Runtime 11 are made only for 2019 version. I don't recommend using JBR 11 with IntelliJ IDEA 2018.3.

0

Hi @Serge

I see the that the 2019.1 EA build has JDK "1.8.0_202-release-1483-b4" bundled with it. I know using the process described on this page, one can use any other jdk (JDK 11) as the boot JRE. I have 2 questions:

1. Will 2019 Idea have both jdk8 and jdk11 bundled with it? Or to use JDK 11 as the boot JRE, one has to follow the above process?

2. Will the JRE 11 be available on bintray? (Currently only JBSDK 11 is available which is pretty huge in size. We need only the JRE to start our product on Java 11. Packaging JDK 11 will make our binary too big.) If yes, can the ea builds of jre 11 can be uploaded on bintray soon? Thanks

 

 

0

1. We are providing both versions depending on the download, see https://www.jetbrains.com/idea/nextversion/ .

2. As far as I know, it's not planned. One can use https://docs.oracle.com/en/java/javase/11/tools/jlink.html to build application specific runtime.

0

Thanks Serge

I see that the jbr version for Java 11 is out on BinTray -

jbr-11_0_2-osx-x64-b159.tar.gz

The path to java executable is different in these as compared to the earlier jbre8 versions.

Now the java executable is under 

com.jetbrains/jbre/jbr-11_0_2-osx-x64-b159/jdk/Contents/Home

rather than

com.jetbrains/jbre/jbr-11_0_2-osx-x64-b159/jdk/Contents/Home/Jre  

which causes NPE in finding the Java executable in org.gradle.api.tasks.JavaExec 

@Nullable
public String getExecutable() {
return this.javaExecHandleBuilder.getExecutable();
}

Not sure where this should be fixed. In Gradle or in the plugins which are calling the Gradle getExecutable() method or it is something to be taken care of on your side.

Any ideas?

 

0

Hi,

I was super excited to see that IntelliJ Idea 2019.1 was released but went looking for the Java 11 boot JDK version and I don't see it?

The one that I see has the Java 8 boot JDK.

So I had to follow these steps and download the JB Ideas Java 11 boot JDK and install the plugin in 2019.1 to switch over?

What's the deal? Why isn't there a 2019.1 Java 11 book JDK download available like there was a during the EA cycle?

Thanks

0

Which environment variables in which order are used to determine the JDK used to run the IDE?

On my Mac running Mojave (OSX 10.14.3) , even though i downloaded IDEA 2019.1 with bundled JDK 11, it will always start using JDK 8.

I do set JAVA_HOME and JDK_HOME in ~/.profile but even if I unset those in a terminal and start IDEA from command line, it uses JDK 8.

Edited by Oliver Limberg
0

You probably have idea.jdk file in the IDE config directory overriding the bundled JDK. These environment variables have lower priority than idea.jdk file.

0

@Serge Thanks for the reply and yes, I do have a idea.jdk file but it points to '/Applications/IntelliJ IDEA.app/Contents/jdk'.

0

Try removing it, you don't need to specify the bundled JDK explicitly.

0

Even after deletion, IDEA won't use the bundled SDK

See the output from the command line:

 

PN-235:~ olimberg$export IDEA_LAUNCHER_DEBUG=true
PN-235:~ olimberg$/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
2019-04-17 11:40:08.823 idea[48285:4287367] Reading at /Users/olimberg/Library/Preferences/IntelliJIdea2019.1/idea.properties OK
2019-04-17 11:40:08.825 idea[48285:4287367] allVms required 1.8*,1.8+
2019-04-17 11:40:08.831 idea[48285:4287367] Found Java Virtual Machines:
2019-04-17 11:40:08.831 idea[48285:4287367] /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk
2019-04-17 11:40:08.831 idea[48285:4287367] /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk
2019-04-17 11:40:08.831 idea[48285:4287367] /Applications/IntelliJ IDEA.app/Contents/jdk
2019-04-17 11:40:08.832 idea[48285:4287367] Required VMs: 1.8*,1.8+
2019-04-17 11:40:08.832 idea[48285:4287367] Chosen VM:
2019-04-17 11:40:08.832 idea[48285:4287367] /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk
2019-04-17 11:40:08.836 idea[48285:4287381] Value of IDEA_VM_OPTIONS is (null)
2019-04-17 11:40:08.839 idea[48285:4287381] Processing VMOptions file at /Users/olimberg/Library/Preferences/IntelliJIdea2019.1/idea.vmoptions
2019-04-17 11:40:08.870 idea[48285:4287381] Reading at /Users/olimberg/Library/Preferences/IntelliJIdea2019.1/idea.vmoptions OK
2019-04-17 11:40:08.870 idea[48285:4287381] Done
Already running

It does now about the bundled SDK, but prefers to use 1.8 insted of 11

0

Does the reinstall from http://www.jetbrains.com/idea/download/index.html help? It could be that bundled Java is broken in your current installation (in /Applications/IntelliJ IDEA.app/Contents/jdk).

You can also verify the app bundle signature with:

codesign -vvvv /Applications/IntelliJ IDEA.app/
Edited by Serge Baranov
0

No, a reinstall did not fix the problem. The app bundle signature is valid according to the command provided by you.

 

I deleted 2019.1-jbr11 and tried version 2019.1-jbr8. Starting IDEA from command line, I get a different output:

PN-235:~ olimberg$/Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
2019-04-17 14:25:09.795 idea[52626:4596655] Reading at /Users/olimberg/Library/Preferences/IntelliJIdea2019.1/idea.properties OK
2019-04-17 14:25:09.797 idea[52626:4596655] allVms required 1.8*,1.8+
2019-04-17 14:25:09.798 idea[52626:4596655] Found Java Virtual Machines:
2019-04-17 14:25:09.798 idea[52626:4596655] /Applications/IntelliJ IDEA.app/Contents/jdk
2019-04-17 14:25:09.798 idea[52626:4596655] Required VMs: 1.8*,1.8+
2019-04-17 14:25:09.798 idea[52626:4596655] Chosen VM:
2019-04-17 14:25:09.798 idea[52626:4596655] /Applications/IntelliJ IDEA.app/Contents/jdk
2019-04-17 14:25:09.801 idea[52626:4596663] Value of IDEA_VM_OPTIONS is (null)
2019-04-17 14:25:09.801 idea[52626:4596663] Processing VMOptions file at /Users/olimberg/Library/Preferences/IntelliJIdea2019.1/idea.vmoptions
2019-04-17 14:25:09.801 idea[52626:4596663] Reading at /Users/olimberg/Library/Preferences/IntelliJIdea2019.1/idea.vmoptions OK
2019-04-17 14:25:09.801 idea[52626:4596663] Done

Out of nowhere, the other JDK versions are not even found. 

I might have to add, my file system is case-sensitive, which is not the default for Mac, but should not be a Problem.

0

Thank you very much. The EAP version indeed uses the correct JDK.

 Thanks again for your help.

0

Any idea of when PhpStorm will come bundled with Java 11? Automatic rescaling on DPI changes in Linux works in PyCharm but not PhpStorm and it's very aggravating I need to close & reopen PhpStorm to adjust to the new DPI.

0

@Copong PhpStorm will bundle JDK 11 starting from 2019.2. 

0

Hi,

Need some help here. Before intellij 2019.1.2 was released, I manually downloaded and switched my JBR 11 to b125 (Using Switch IDE Boot JDK). Later, the intellij 2019.1.2 is released, and supposed to come with JBR 11  v11.02+9-b159.56. But the automatic updates through intellij toolbox didn't seem to make intellij pickup the latest JBR 11 v11.02+9-b159.56. Is there a way to make the intellij pickup the JBR that it is shipped with?

 

Thanks!

 

 

0

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

Edited by Serge Baranov
1

As an IJ plugin provider I would like to support whichever JBR the user configures, but Java 11 makes this difficult esp. with respect to the module system (JPMS).  For instance, the JPMS can be used in three distinct modes:

  1. No module: IntelliJ uses `-source 8` compatibility mode
  2. Single "unnamed" module: IntelliJ does not declare module names e..g., no `module-info.java` files
  3. Multi-module: IntelliJ declares module names e.g., uses `module-info.java` files

Can JB provide which module mode IntelliJ uses under JBR 11?  Thanks!

0

Scott,

IntelliJ-based IDEs still can be run under Java 8. Although we provide distributions with bundled JBR 11, it still possible to download a distribution which bundles JBR 8, and we're going to keep this possibility at least for 2019.2 versions. So currently IntelliJ Platform is compiled by Java 8.

0

Hi Nikolay, thanks for your reply.  As a plugin author I'm more concerned about my plugin working in the environment of the user's choosing.  Therefore, knowing the particulars of IntelliJ's usage of the JPMS in JBR 11 would be a great help.  I suppose I can dig in and figure that out for myself.  Thanks.

Edited by Scott McKinney
0

Please sign in to leave a comment.

Have more questions?

Submit a request