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 Choose Runtime plug-in

  1. Install the Choose Runtime plugin (screenshot).
  2. Start the IDE, use Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Choose Runtime", 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. Installing old runtime versions may render your IDE unusable or introduce new issues.
  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 the installed runtimes

See the previous section. After installing the plug-in use the Choose Runtime action to switch between the different local runtimes:

Help | Find Action (Ctrl+Shift+A or Cmd+Shift+A on Mac), type "Choose Runtime", press Enter.

idea64_2019-09-18_19-11-16.png

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 build available on your system (JDK 11+ 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.

Mac OS X

  • 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/jdk1.8.0_112.jdk
164 comments
Comment actions Permalink

I couldn't get Android Studio pick up JDK 1.8 either using just the idea.properties files.
I ended up using the STUDIO_JDK: http://stackoverflow.com/a/32952022/3055345 .
Maybe there's an equivalent for vanilla Idea.

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

I am not sure how the linked article helps me. I don't see any reference to Maven or running IntelliJ 15 on OSX with Java 8 - which I guess is the default download now - and the fact that the default options for it don't work.

0
Comment actions Permalink

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

0
Comment actions Permalink

Hello and Happy New Year.
I do not understand why this is not working in my Intellij 15.0.2 IDEA. I have jdk version 1.8.0_11 installed in Program files(x86) /Java on my Windows 8.1 machine and have the project SDK pointing to that library. I have set the Language Level to " 8 - Lambdas, ....." for both Projects and Modules in the Project Settings window. Intellij continues to show a compiler error - red squiggly underscore -under this entire lambda statement:

() -> 5 the error shown when mousing over is "Lambda expression not expected here"
When I click on Help->About I see the JRE that the IDEA is using is 1.8.0_51-b16 X86. So I created a IDEA_JDK environment variable pointing to the same Java 8 library even though the project settings already are set to point to the Java 8 library. Creating this environment variable changed the Java version the IDE is using to 1.8.0_11-b12 amd64. That is fine however I continue to get the compiler error mentioned.
Can somebody please advise? What am I missing? Why are these settings not working? Thank you for your time
Gary

0
Comment actions Permalink

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
Comment actions Permalink

WebStorm uses WEBIDE_JDK. 2016.1 version requires Java 8 version to run. If you have Java 8 installed and run webstorm64.exe, it should find it automatically from the registry.

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

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

0
Comment actions Permalink

Thanks for your fast response Serge! I removed all Java versions from my machine, when I now run `java -version` in terminal, it says that Java is not installed (I even reinstalled PhpStorm and rebooted, just to be sure). Tried to fire up PhpStorm again, but still got the message that PhpStorm was unable to find a suitable Java version.

Then I tried János Pál's suggestion. So I reinstalled Java 8 JDK and then set JAVA_HOME to the location of the Java 8 JDK, as explained here:

http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/

Now if I run `echo $JAVA_HOME` in terminal, it tells me the location, so that works. Still PhpStorm doesn't start.

0
Comment actions Permalink

I was able to resolve the issue about PhpStorm not being able to find the correct JVM by doing the following:

I removed all Java versions from my machine. Then, in this file

~/Library/Preferences/PhpStorm2016.1/idea.properties

There is a property that says

JVMVersion=1.6*

I removed that line and all is fine now.

0
Comment actions Permalink

I've downloaded PyCharm 2016.1, installed in and try to start. I get the following error:

Unsupported Java Version: Cannot start under Java 1.7.0_95-b00: Java 1.8 or later is required.

I have openjdk 1.7 installed, but as I've read, PyCharm brings it's own JRE with it. But why the contained JDK isn't used? I've tried to start the java binary in the $IDE_HOME/jre/jre/bin/ folder, but it seems a 64 bit executable. I'm on a 32 bit Ubuntu system.

Is the contained JRE only 64 bit? Do I have to install JRE from Oracle? But then I have nothing of the improvements you made in openjdk to provide better user experience on Linux (like font rendering improvements and HiDPI support).

0
Comment actions Permalink

Yes, we provide 64-bit Java on Linux. If you are on a 32-bit system you have to install 32-bit Java 8 manually.

0
Comment actions Permalink

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
Comment actions Permalink

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
Comment actions Permalink

Everything correct and you still use the wrong Java:

~ Darwin martin@iMac Sa Mär 26 11:30:35 standart 0

>echo $JAVA_HOME

/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home

~ Darwin martin@iMac Sa Mär 26 11:30:40 standart 0

>echo $JDK_HOME

/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home

~ Darwin martin@iMac Sa Mär 26 11:30:44 standart 0

>java -version

java version "1.8.0_77"

Java(TM) SE Runtime Environment (build 1.8.0_77-b03)

Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

~ Darwin martin@iMac Sa Mär 26 11:30:49 standart 0

>/Applications/Developer/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea

2016-03-26 11:30:57.410 idea[2046:25499] Value of IDEA_JDK: (null)

2016-03-26 11:30:57.416 idea[2046:25505] fullFileName is: /Applications/Developer/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions

2016-03-26 11:30:57.416 idea[2046:25505] fullFileName exists: /Applications/Developer/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions

2016-03-26 11:30:57.417 idea[2046:25505] Value of IDEA_VM_OPTIONS is (null)

2016-03-26 11:30:57.417 idea[2046:25505] Processing VMOptions file at /Applications/Developer/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions

2016-03-26 11:30:57.417 idea[2046:25505] Done

 

Unsupported Java Version: Cannot start under Java 1.6.0_65-b14-468-11M4833: Java 1.8 or later is required.

~ Darwin martin@iMac Sa Mär 26 11:30:58 standart 10

>

What a pain. But wait. What is IDEA_JDK?

0
Comment actions Permalink
export IDEA_LAUNCHER_DEBUG=true
/Applications/Developer/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea

Attach the output again.

0
Comment actions Permalink

The following did the trick:

typeset -x -g IDEA_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk

Interesting. Why was it null? And no I did not change any property files. At least not since the update from IDEA 15.

0
Comment actions Permalink

IDEA_JDK is not needed, by default IDE will use the bundled JDK.

0
Comment actions Permalink

The requested output from a fresh command line (to make it fail):

—————

>/Applications/Developer/IntelliJ\ IDEA\ CE.app/Contents/MacOS/idea

2016-03-26 11:40:21.640 idea[2520:32862] Value of IDEA_JDK: (null)

2016-03-26 11:40:21.640 idea[2520:32862] Reading at /Users/martin/Library/Preferences/IdeaIC2016.1/idea.properties OK

2016-03-26 11:40:21.642 idea[2520:32862] Found Java Virtual Machines:

2016-03-26 11:40:21.642 idea[2520:32862] /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk

2016-03-26 11:40:21.642 idea[2520:32862] /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk

2016-03-26 11:40:21.642 idea[2520:32862] /Applications/Developer/IntelliJ IDEA CE.app/Contents/jre/jdk

2016-03-26 11:40:21.642 idea[2520:32862] /Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk

2016-03-26 11:40:21.642 idea[2520:32862] /Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk

2016-03-26 11:40:21.642 idea[2520:32862] /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk

2016-03-26 11:40:21.642 idea[2520:32862] /Library/Java/JavaVirtualMachines/1.6.0.jdk

2016-03-26 11:40:21.642 idea[2520:32862] Required VMs: 1.6*

2016-03-26 11:40:21.642 idea[2520:32862] Chosen VM:

2016-03-26 11:40:21.642 idea[2520:32862] /Library/Java/JavaVirtualMachines/1.6.0.jdk

2016-03-26 11:40:21.647 idea[2520:32873] fullFileName is: /Applications/Developer/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions

2016-03-26 11:40:21.647 idea[2520:32873] fullFileName exists: /Applications/Developer/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions

2016-03-26 11:40:21.647 idea[2520:32873] Value of IDEA_VM_OPTIONS is (null)

2016-03-26 11:40:21.647 idea[2520:32873] Processing VMOptions file at /Applications/Developer/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions

2016-03-26 11:40:21.647 idea[2520:32873] Reading at /Applications/Developer/IntelliJ IDEA CE.app/Contents/bin/idea.vmoptions OK

2016-03-26 11:40:21.647 idea[2520:32873] Done

 

Unsupported Java Version: Cannot start under Java 1.6.0_65-b14-468-11M4833: Java 1.8 or later is required.

—————

Interesting again: Required VMs: 1.6* — where did that one come from? I checked the Info.plist — it correctly requests 1.8.

0
Comment actions Permalink

It comes from your /Users/martin/Library/Preferences/IdeaIC2016.1/idea.properties file which was migrated from the previous version, see https://youtrack.jetbrains.com/issue/IDEA-153217 that I've already linked above.

0
Comment actions Permalink

For PyCharm on Mac, the file name is pycharm.jdk and not charm.jdk as mentioned.

Run the following command in Terminal:

echo "/Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk" > ${HOME}/Library/Preferences/PyCharm2016.1/pycharm.jdk

Replacing the string "jdk1.8.0_77" with whatever version of Java you have installed.

0
Comment actions Permalink

Hello! I've just installed PyCharm 2016.1.3, since i'm on windows and i need to run 64-bit (i need to use the ODBC data sources on the machine), i need to install JDK 8. The JDK available to my firm is only JDK 1.8.0_05. I've defined PYCHARM_JDK variable and pointed it to:

C:\Program Files\Java\jdk1.8.0_05.

PyCharm now starts, but it doesn't support 64-bit functionality, meaning, my ODBC data sources are not supported and i'm receiving an error when i try to run a query against them:

Exception in thread "main" java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver

I confirm that PyCharm is running as 64-bit:

PyCharm 2016.1.3
Build #PY-145.971, built on May 3, 2016
JRE: 1.8.0_05-b13 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

So, is this JDK not supported or is this an issue?

0
Comment actions Permalink

It's unrelated to JDK, please submit a ticket to support and attach a screenshot with your JDBC driver configuration (jar files) in the database connection properties.

0
Comment actions Permalink

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
Comment actions Permalink

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

Please sign in to leave a comment.

Have more questions?

Submit a request