0

Okay. So I downloaded java 12.0.1 and I have set my JAVA_HOME and path variables to my jdk bin loaction. In CMD, when I run java -version, it does work, and I get the version. Everything works fine.

Problem:

However, in the libGDX setup (gdx-setup.jar) when I try to Generate Code, I get this following error:

ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\jdk- 
12.0.1\bin

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.

However, any other app that uses Java works (such as Eclipse IDE).

What am I doing wrong? Does libGDX not support java 12.0.1?

Community
  • 1
  • 1
CodingM
  • 350
  • 3
  • 18
  • JAVA_HOME doesn't usually include the bin folder. It usually just points to the folder of the jre or jdk. So in your case, I'd try to set `JAVA_HOME to C:\Program Files\Java\jdk- 12.0.1 `. – tronski Jun 08 '19 at 15:05

1 Answers1

0

It looks like this gaming framework libGDX best supports java 7(jkd 1.7). Refer below the links. You can install Jdk 7 or 8 and you can try.

https://github.com/libgdx/libgdx/issues/4619

https://www.badlogicgames.com/forum/viewtopic.php?f=11&t=25857

Sambit
  • 7,625
  • 7
  • 34
  • 65
  • I cannot install JDK 7 beacuse it is not supported anymore by oracle, and JDK give me Error Code 13 when I start ecplise. – CodingM Jun 08 '19 at 15:44
  • You can install, Oracle says they do not support from an enterprise installation view point. But for development, you can install. Go to Oracle archive site and you can download. – Sambit Jun 08 '19 at 15:48
  • LibGDX supports Java 12 without any problem, this is wrong. – Nicolas Jun 08 '19 at 20:32
  • 1
    @Nicolas, I never said it supports or not, I provided some useful links to the user so that he can try. You made wrong inference. – Sambit Jun 08 '19 at 20:40
  • 1
    @Nicolas JDK 12 does not work in libGDX, have you even read my question? – CodingM Jun 08 '19 at 21:14
  • @CodingM I'm using JDK 11 and it works fine, it shouldn't be any different with JDK 12, since java is (mostly) backward compatible. In any case, as tronski pointed out, your java home is wrong, which is likely the reason why it doesn't work. – Nicolas Jun 08 '19 at 21:19
  • @Nicolas Ive tried a lot of things. I will try JDK 11, with what is suggested. – CodingM Jun 09 '19 at 01:55
  • @Nicolas Currently I have JDK 8 installed and the path correctly set. For some reason, this ONE time it worked. Pretty surprised as ive tried jdk 8 already. Thanks? – CodingM Jun 09 '19 at 02:02