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

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

, , , . ( 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

. . , , , , . , !
!