Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Home directory for bundled version of JDK in IntelliJ IDEA

I have JDK 7 installed on my machine, but I want to compile against JDK 8 using IntelliJ IDEA.

In the window that opens when choosing Help > About, there is the following line:

JRE: 1.8.0_51-b16 x86

Well, IDE is running on Java 8. In fact, here it states:

JDK 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.

That's great! I should be able to use the bundled version with my projects too. But where is that JDK located?

When selecting the home directory for a new project, the default path is C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.1\jre, but it doesn't work.

The selected directory is not a valid home for JDK

After exploring a bit, I found C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.1\jre\jre\bin. It contains many files, even some called java.exe and javaw.exe, but it doesn't work.

So where is the home directory for the bundled version of the JDK installed with IDEA?

like image 667
Atom 12 Avatar asked Nov 13 '15 18:11

Atom 12


People also ask

What is the home directory for JDK?

The locations of these folders vary depending on your system, but in all versions of Windows, the JDK root folder is in the path Program Files\Java on your boot drive. The name of the JDK root folder also varies, depending on the Java version you've installed. For version 1.7, the root folder is jdk1.

Where do I put Java version in IntelliJ?

From the main menu, select Help | Find Action or press Ctrl+Shift+A . Find and select the Choose Boot Java Runtime for the IDE action. Select the new desired runtime and click OK.


1 Answers

If you want to know, where the bundled JDK is, try this:
[Ctrl+Shift+A] within IDEA and type "JDK" and select "Switch IDE Boot JDK"
You should see the bundled directory and you can switch to an other JDK path.
Please be aware that Java 8 is required to run IntelliJ IDEA starting from version 2016 on all the supported platforms.

EDIT:
Starting with version 2019.1:
[Ctrl+Shift+A] within IDEA and type and select "Choose Runtime..." (requires the 'Choose Runtime' Plugin)

Selecting-the-JDK-version-the-IDE-will-run-under

like image 157
hce Avatar answered Oct 21 '22 11:10

hce