Libgdx does not use the correct JAVA_HOME path

I know there are a lot of questions on JAVA_HOME, and of course I have worked this out before. I have been setting up and running Java code for several years.

I understand that libgdx needs a path to the jdk bit, not the jre bin. When I tried to create a small test file, I got the following error:

ERROR: JAVA_HOME is installed in an invalid directory: C: \ Program Files \ Java \ jre7 \ bin

enter image description here

The invalid directory points to jre bin, so I downloaded jdk and added its path to my environment variables, separated by a semicolon.

C: \ Program Files \ Java \ jdk1.7.0_40 \ bin; C: \ Program Files \ Java \ jre7 \ bin

libgdx, . , . p > a > > > , cmd .

JAVA_HOME = C:\Program Files\Java\jre7\bin
JRE_HOME = C:\Program Files\Java\jre7\bin

enter image description here

, , , . ( JRE_HOME ) jdk JAVA_HOME, , GUI. ,

JAVA_HOME = C:\Program Files\Java\jdk1.7.0_40\bin
JRE_HOME = C:\Program Files\Java\jre7\bin

enter image description here

. . , , , , . , !

!

+4
2

. \bin. , JAVA_HOME, Libgdx, .

\bin PATH.

+7

, JAVA_HOME .

libGDX JAVA_EXE. JAVA_HOME '/bin/java.exe'. :

:findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe

GitHub .

, JAVA_HOME, JDK Java, :

C:\Program Files\Java\jdk1.7.0_40

bin JAVA_HOME, libGDX .

+1

All Articles