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+).

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
133 comments

Just forget my comment above :) i read it all now

0

WIth the release of IntelliJ 2016.2, I see this noted in the blog post announcing it:

Installer

Last but not least, the Windows installer now includes our custom JDK build with fixes that address focus and font rendering issues.

But it appears that is still just the 32-bit JDK (or it seems JRE as that's what the directory is called: "IntelliJ IDEA 2016.2\jre". Is this correct? If we use the 64-bit version do we still have to point IDEA_JDK_64 to our own install? (Seems so from the experimenting I've done.)

Is the 64-bit version slated to get a bundled JDK/JRE build with fixes for these issues at some point? 

Also, idea.bat seems to only want to run idea.exe the way it is written. In fact, it has one issue around 10 lines down where it is using the variable %BITS% which hasn't been set yet. That seems bad to me.

 

 

 

0

Thanks @Henrik, i actually just realized this and have fixed it accordingly! but good to have it written down for reference too

0

What Java version is displayed in About dialog? What's the output from "~/.WebStorm2017.1/config/jdks/jbsdk8u152b845.3_linux_x86/bin/java -version" command?

Edited by Serge Baranov
0

How do I "open" and existing project on intellij 13.1.6  on MAC? it does not show the ij-icon for .iml/.idea folder. it only shows folder that does not tell me if this is correct folder to load project.

build: 135.1306 ultimate on mac x86_64 on macbook pro JRE/JVM hotspot 64 bit by apple

Also if it is not a correct folder for project ( from the open project menu -- where you know user is trying to open an "existing" IJ project) it creates a bad project with new .idea folder/iml file...

can you help ?

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

Hello. I'm not shure it is right place for question, but there https://www.jetbrains.com/idea/help/configuring-global-project-and-module-sdks.html#comment-1716362147 was been forwarded...

Is it possible run Idea say in JDK 1.7, but run/debug some for example in 1.8? It will be very desired have such per run/debug configurations settings.

 

0

my computer system is windows 10. i had setted a environment JDK_HOME ,then run idea64.exe, encounter a mistake, it seemly JDK_HOME is not support by idea64.exe. this is violated with above tutorial

0

If you are using 0xDBE the path variable is dbe_JDK

0

I just downloaded the new 2016.1 version of PHPStorm. When I try to open it, it says it doesn't run with the older Java 1.6 version (which was required for the previous version of PHPStorm). So I uninstalled that and installed Java 1.8. When I type `java -version` in Terminal, it says that version 1.8 is installed. I also added a link to that Java version in the `.jdk` config file which I called `PhpStorm2016.1.jdk` (as explained above).

Now when I try to open PHPStorm it says that a suitable Java version can not be found and it gives me a link to this Apple page (https://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US) where I can download the 1.6 version. So I installed that again and then I'm back where I started, getting the message from PHPStorm that I need version 1.8 of Java instead of 1.6.

So, I seem to be in an infinite loop :(

I'm on OSX by the way (El Capitan 10.11.3)

Please advise what to do, because I am completely stuck and can't work.

0

Only 32-bit JDK is bundled, just like before. What has changed is that we bundle our custom OpenJDK instead of Oracle JDK like we did before.

64-bit version of the custom OpenJDK is available at https://bintray.com/jetbrains/intellij-jdk/.

Thanks for pointing to the %BITS% issue in idea.bat, we'll investigate it.

0

Hi Flemming, yes, I had tried that... no joy.
If you see my comment before this one, it'd seem that the IDE disregards everything once the JVMVersion property has been written to ~/Library/Preferences/<Product><Version>/idea.properties

0

I didn't understand anything.

Please explain me how to change default JDK for Intellij Idea if i can't run Intellij Idea

0

Please sign in to leave a comment.

Have more questions?

Submit a request