libgdx not using correct JAVA_HOME path

▼魔方 西西 提交于 2019-12-01 20:17:37

I had the same problem too. You need to remove \bin. Also, if you change the JAVA_HOME environment variable, you'll need to restart the Libgdx Project Generator, otherwise it will not use the latest variable value.

You'll only have to include \bin inside the PATH variable.

Make sure your JAVA_HOME environment variable does not contain a semi-colon at the end of the path.

libGDX also specifies a JAVA_EXE variable. To do this they append the JAVA_HOME variable to include '/bin/java.exe'. This can be seen in the code below:

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

The full code can be reviewed on GitHub here.

Keeping the above information in mind, change your JAVA_HOME variable to point to the JDK version of Java you have installed:

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

It is not necessary to include the bin folder in your JAVA_HOME variable as libGDX does this for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!