Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA "The selected directory is not a valid home for JDK"

I just installed IntelliJ IDEA and I'm trying to set it up. I've gotten to the part where I need to select my home directory for my JDK.

I tried navigating to my Java installation, C:\Program Files (x86)\Java, and clicked okay but it told me the message above. So, I tried C:\Program Files (x86)\Java\jre7 and that didn't work either.

I tried reinstalling the latest JDK (from here) and I still couldn't choose my JDK. I even dragged the .jar installer I got from the website and the file selector window wouldn't recognize it.

I'm at a standstill and I don't know what to do.

like image 570
Maurdekye Avatar asked Feb 11 '14 21:02

Maurdekye


People also ask

How do I fix the selected directory is not a valid home for JDK?

First at all, you need to select the C:\ folder. Then, you select Program Files. After it, you select java, and finally the jdk you downloaded.

What is the home directory for JDK?

Now home directory for jdk will be: "C:\Program Files\Java\jdk1.

Can IntelliJ run without JDK?

You do not need to install Java to run IntelliJ IDEA because JetBrains Runtime is bundled with the IDE (based on JRE 11). However, to develop Java applications, a standalone JDK is required.


2 Answers

Because you are choosing jre dir. and not JDK dir. JDK dir. is for instance (depending on update and whether it's 64 bit or 32 bit): C:\Program Files (x86)\Java\jdk1.7.0_45 In my case it's 32 bit JDK 1.7 update 45

like image 71
Branislav Lazic Avatar answered Oct 06 '22 01:10

Branislav Lazic


This error occurs because if you choosing the path deep in JDK or JRE. The exact path that should be chosen is in my case 64 bit

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

if 32 bit

C:\Program Files (86)\Java\jdk1.8.0_91

like image 22
Koushal Deva Avatar answered Oct 06 '22 00:10

Koushal Deva