I'm encountering a problem with the forked Grails process when executing from GGTS via run-app after upgrading to Java 1.8. It insists on running the forked instance of the application in the older Java 1.7 JVM after the having compiled everything with 1.8. This leads to an incompatible JVM error at runtime:
Caused by UnsupportedClassVersionError: Grails/plugin/springsecurity/userdetails/GrailsUserDetailsService : Unsupported major.minor version 52.0
I have spent some time looking around to see if others have encountered this and the answer is yes. But ... no real solutions other than re-installing GGTS.
Here is the information about my environment:
JAVA_HOME = /usr/lib/jvm/jdk1.8.0_65
GGTS.ini = /usr/lib/jvm/jdk1.8.0_65
Installed JRE's = /usr/lib/jvm/jdk1.8.0_65
I have NO Installed 1.7 JRE in my Workspace. I've checked a dozen times.
The GGTS instance is running inside a 1.8 jvm. The long running Grails process is running inside a 1.8 jvm. If I run grails from bash both it and the forked grails instance are running inside a 1.8 jvm. If I do a run app from GGTS however the forked grails runs in an old 1.7 jvm. I cannot find any reference in any configuration for a 1.7 jvm including .grails, GGTS.ini or any of the .eclipse settings files in the Workspace. Clearly there is some file somewhere that has a "cached" reference to the 1.7 JVM that I can't find. If I turn off forking in the BuildConfig.groovy, then it launches Grails in the primary process in a 1.8 JVM and everything works.
Finally, if I create a new Workspace then I can get it to run Grails in Java 1.8. As soon as I switch back to an older project with an older version of Grails and a Java 1.7 configuration, then magically the 1.7 JVM becomes preferred for the forked instance of Grails for all workspaces.
The fork directives in the BuildConfig.groovy specify arguments for the JVM but not the actual JVM itself. Where does that come from?