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 version of Oracle JDK or OpenJDK available for your system (OpenJDK 1.6 is not supported, please use 1.7 or later versions, 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
121 comments

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.

1

No, you are mixing up the location of the JDK itself and the location of the text .jdk file that overrides the default JDK.

Edited by Serge Baranov
1

Hi, 

 My JAVA_HOME is set to a Jrockit version. So, I created JDK_HOME and set it to Java 7. But when I click on idea64.exe, it is still trying to search for JAVA_HOME rather than JDK_HOME. (IDEA build 141.177).

0

My apologies, plugin was disabled, all good. Thank you.

0

Eh ... I find that the JVMVersion's string value would be uesd to match the FILE NAME in the path "/Library/Java/JavaVirtualMachines/" . So it will not work any more if the file name doesn't contain the String "1.6/1.7/1.8" ...

0

What error do you get? Please contact support with more details.

0

Try setting IDEA_JDK_64 instead. We have changed the launcher some time ago, so the order/variables may be a bit different.

0

You probably have an environment variable set which overrides the default runtime and has the priority over the config file which is changed via UI, hence the behavior you are describing.

0

The link above points to the binary builds, you just download and unpack it into IDEA_HOME/jre64 folder. For example, here is the link to the current Windows version of the custom 64-bit JDK: https://bintray.com/jetbrains/intellij-jdk/download_file?file_path=jbsdk8u76b218_windows_x64.tar.gz.

0

Serge, even the bundled one won't work if you opened the same version (but unbundled) before when using Java6, as ~/Library/Preferences/<Product><Version>/idea.properties would already be written.

Frank: I don't find that to be the case. I just changed JVMVersion to 1.8 and it picked up my JDK 8 from Oracle.

0

@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

How can I run Idea 12 with the default Java 6 VM and target code and binaries to Java 7?

0

I have two Java 8 installed:

 

>la /Library/Java/JavaVirtualMachines                              

total 0

drwxr-xr-x  7 root  wheel  -  238B 13 Dez 17:56 ./

drwxrwxr-x  6 root  wheel  -  204B 13 Dez 17:56 ../

drwxr-xr-x  3 root  wheel  -  102B 14 Jul  2015 1.6.0.jdk/

drwxr-xr-x  3 root  wheel  -  102B 10 Dez 00:49 jdk1.7.0_45.jdk/

drwxr-xr-x  3 root  wheel  -  102B 10 Dez 01:12 jdk1.7.0_67.jdk/

drwxr-xr-x  3 root  wheel  -  102B 10 Dez 00:26 jdk1.8.0_20.jdk/

drwxr-xr-x  3 root  wheel  -  102B 10 Dez 01:13 jdk1.8.0_66.jdk/

 

Why do you show an error message telling me too install one. Now i have to read tons of doku, change config files and whatever else. How about you make it that is “just works”. It is not that difficult to look in /Library/Java/JavaVirtualMachines for a java which will do the trick.

0

Trying to do this for Webstorm (10.2) 64 bit using the exe vs bat and it still looks @ JAVA_HOME.   I have set WEBIDE_JDK, WEBIDE_JDK_64, IDEA_JDK, IDEA_JDK_64 to all point to a specific version of JDK and it stills uses JAVA_HOME as the jdk.  My scenario, I have two flavors of jdk installed and JAVA_HOME is set to an older version of JDK. 

0

Serge, I have JDK 8 (x64) installed, WebStorm did not find it using the IDEA_JDK_64 environment variable, it was only checking JDK_HOME which was set to JDK 7 (x64), so it didn't start. So the JDK search sequence seems to be broken.

The two things that worked was either changing the JDK_HOME variable to JDK 8, which was undesirable or copying my Java 8 JDK's jre folder to IDE_HOME\jre. This works perfectly, while JAVA_HOME can remain at JDK 7, so I just wanted to share my experience.

0

I downloaded IntelliJ 15 for OSX. It downloaded IdeaIU-15.0.1-custom-jdk-bundled.dmg by default. Upon startup all of my projects failed to load saying the maven projects failed to load. In the log I am seeing MavenServerManager failing to reconnect. I tried to run IntelliJ 14 with Java 8 in the past and found that I had to set java.net.preferIPv4Stack=false to get it to work. IntelliJ 15 comes with the value preset to true.

I was able to download IdeaIU-15.0.1.dmg and it runs without that problem but it gives me a warning that updates cannot be automatically downloaded because it is running on Java 6.

0

It just works if you didn't modify any .properties files overriding the Java version since Java 8 is bundled by default. See https://youtrack.jetbrains.com/issue/IDEA-153217.

0

Hi there,

is Oracle JDK 1.7 still the recommended version for Linux? Or is it safe to switch to Oracle 1.8, or God forbid, OpenJDK?

Cheers!

0

WebStorm doesn't use IDEA_JDK_64. It's IntelliJ IDEA specific. Every product has its own variable. Please check the article again. Example is for idea64.exe only.

0

Hi,

I found a minor bug in this workflow.

Under Windows when upgrading from WebStorm 11.0.3 (x86) to WebStorm 2016.1 (x64), the IDE_HOME\jre was copied directly from the previous installation, which of course was 32-bit java and the IDE couldn't use it. Then WebStorm ignored the IDEA_JDK_64 environment variable and only tried to use JAVA_HOME which is set to Java 1.7 in my case for different platforms to use. Eventually I copied the contents of my 64-bit JDK installation's jre folder to IDE_HOME\jre and the IDE started fine.

János

0

We don't package it by default to save size of the distribution since for the most users 32-bit version will work just fine. 64-bit version is needed only in case you need to use heap sizes higher than 1GB (when working with large projects or many projects at the same time). 64-bit version has more RAM overhead. Bundling both versions would make the download size much larger, bundling only 64-bit version will make it unusable for users on 32-bit systems.

0

See https://intellij-support.jetbrains.com/entries/23395793 to chnage the value of this property. Disable secure updates to make it work on 1.6: http://i.imgur.com/p037pW2.png .

0

You can use 1.8 Oracle JDK or OpenJDK on Linux.

0

Cool, thanks! Sorry, I didn't read carefully enough.

0

PhpStorm comes with bundled Java on Mac. If you don't have .jdk file, it should run on the bundled JDK by default. See also https://intellij-support.jetbrains.com/hc/articles/206544879. I've submitted a bug for the 1.6 installation suggestion: https://youtrack.jetbrains.com/issue/IDEA-153217. Please vote. Submit a ticket to support if you still have a problem.

0

Please submit a support ticket with more details and idea.log.

0

Can I change the jdk used for database connections without changing the ide  jdk version?

0

Great, thank you! Maybe the original post could be updated?

0

Please sign in to leave a comment.

Have more questions?

Submit a request