10

When first launching IntelliJ IDEA Community Edition 14.0.2 on Windows 7 x64 I received the following error when trying to import the sample libGDX gradle config:

Intellij 14 the supplied javaHome seems to be invalid

The IDE is looking in C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.0.2\jre for the java runtime, but the files exist in a sub directory off this one: C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.0.2\jre\jre.

My solution was to copy the contents of jre\jre up one level to jre, which solved the problem - but doesn't feel like the right thing to do.

Is this an acceptable solution, or is there a 'better way' to solve this? It feels strange to me that the default install is not in the correct location; but there might be something environmental that I'm not quite understanding.

This was recorded as a duplicate, but it is not - it is a different product. Android Studio is a different product to IntelliJ-Idea.

Rots
  • 5,506
  • 3
  • 43
  • 51
  • Finally a solution that works! I agree that it is a weird fix but I've wasted enough time on this issue. – cory.todd Mar 31 '15 at 14:50
  • possible duplicate of [Android Studio - supplied javaHome is not a valid folder](http://stackoverflow.com/questions/22749200/android-studio-supplied-javahome-is-not-a-valid-folder) – Toby Allen May 04 '15 at 06:50
  • @Toby Allen this is not Android studio this is Intellij Idea - a different product. – Rots May 04 '15 at 09:13
  • There is another Stackoverflow question with the answer to your issue. Here is the link to the solution. http://stackoverflow.com/questions/22749200/android-studio-supplied-javahome-is-not-a-valid-folder Worked perfectly for me and from the question you have posted , it is the working solution. – 89n3ur0n May 04 '15 at 05:23

1 Answers1

10

Since you have a 64-bit Java as your JAVA_HOME, run the 64-bit version on IntelliJ instead, idea64.exe in the bin directory of your IntelliJ installation; for example:

C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 14.0.2\bin\idea64.exe
MotohawkSF
  • 2,503
  • 22
  • 10