Grails And JAVA_HOME
Hello,
I am using IDEA 8.1.2 with a Grails project generated by the IDE itself. Everythings are fine until I try to create an integration test. Following error message was received,
ERROR: JAVA_HOME is set to an invalid directory: C:/Program Files (x86)/Java/jdk1.6.0_13
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
I have checked JAVA_HOME was set and was able to create an intergration test in the DOS command prompt outside the IDE. Since I am using Windows OS, would the problem be related to the '/' slash character generated internally by IDEA?
Thanks.
Please sign in to leave a comment.
After some further investigation, it seems to be a bug in 8.1.2. The problem is resolved when downgrade to previous version, 8.1.1.
Thanks.
Thanks - you just saved me an additional 2 hours troubleshooting JAVA_HOME.
I have the same error with a fresh 8.1.2 installation.
The "create-app" works fine, but generating comain classes or other artefacts fails due to the / character in the path, which is unexpected by startGrails.bat when verifying the Java installation.
Regards
Henrik Fjorback
A quick fix is to edit startGrails.bat and insert the following at line 46 after the :have_JAVA_HOME label
set JAVA_HOME=%JAVA_HOME:/=\%
This problem will be fixed in 8.1.3, thank you
When will you release 8.1.3?
This is what I did.
If you find this in your startGrails.bat
%COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
comment it; in windows:
@rem %COMMAND_COM% /C DIR "%JAVA_HOME%" 2>&1 | %FIND_EXE% /I /C "%JAVA_HOME%" >nul
Robert
yes, this is exactly what I did to fix this issue, I also twittered Grails team on this, their answer was none of them were using windows platform, contributions to cmd programs are welcome :--)