2

I just installed Grails 3.3.8 but when I'm trying to run a sample application I got the below error :

Error |
Error initializing classpath: Could not determine java version from '10.0.2'.
java.lang.IllegalArgumentException: Could not determine java version from '10.0.2'.
at org.gradle.api.JavaVersion.toVersion(JavaVersion.java:68)
at org.gradle.api.JavaVersion.current(JavaVersion.java:78)
at org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:66)
at org.gradle.tooling.internal.consumer.ConnectorServices.close(ConnectorServices.java:53)
at org.gradle.tooling.internal.consumer.DefaultGradleConnector.close(DefaultGradleConnector.java:57)
at org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:78)
at org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:526)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:509)
at org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:307)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:270)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)

Error |
 Error initializing classpath: Could not determine java version from '10.0.2'.

Process finished with exit code 1

my java version is java version "10.0.2" 2018-07-17, Windows 10 64bit, the JAVA_HOME was already set and using intellj

SShehab
  • 1,039
  • 3
  • 17
  • 31
  • The old gradle version that get's used there (3.5.x) does not work with Java 10. AFAIK 4.7 introduced official support. – cfrick Sep 18 '18 at 08:01
  • I installed the latest GRADLE 4.10.1 and configured the IntelliJ to use it but still having the same error – SShehab Sep 18 '18 at 08:20
  • You have to do that in your project. Grails integrates with gradle. But i have my strongest doubts, that it will work. There are lots of changes between 3.5 and 4.10 – cfrick Sep 18 '18 at 09:07
  • @cfrick any recommendations for doing this? – SShehab Sep 18 '18 at 09:11
  • Changing the Gradle version is not going to help. Grails 3.3.8 does not support Java 10. – Jeff Scott Brown Sep 18 '18 at 14:32

1 Answers1

4

Grails 3.3.8 does not support Java 10. You will have to use Java 7 or Java 8 if you want to use Grails 3.3.8.

Jeff Scott Brown
  • 26,804
  • 2
  • 30
  • 47
  • 1
    Can we assume, Grails 3 dies with JDK8? – cfrick Sep 18 '18 at 15:05
  • 1
    "Can we assume, Grails 3 dies with JDK8?" - No. Grails 3 works fine with JDK8. – Jeff Scott Brown Sep 18 '18 at 15:07
  • 2
    I meant, since JDK8s EOL is determined, can we assume, that the Grails 3 line lives and dies with the support for it? And that a Grails supporting JDK11 will most likely be of the "4" line (e.g. mn based)? – cfrick Sep 18 '18 at 15:12
  • 1
    We don't drop support for Grails when the relevant JDKs EOL. We have a lot of customers still using Grails 2, for example, and we support them. Grails 4 is the first version of Grails which will support a JDK greater than 8. – Jeff Scott Brown Sep 18 '18 at 15:15
  • 1
    @JeffScottBrown I downgrade to Java 8 and the application started successfully – SShehab Sep 18 '18 at 23:39
  • @SShehab That makes sense. I am glad you got it working! – Jeff Scott Brown Sep 20 '18 at 03:06
  • @JeffScottBrown It's nice that _you_ support it, but if people have to move away from the Java 8 JVM because of its EOL, what are they supposed to do? – Raphael Oct 11 '18 at 07:32
  • "...but if people have to move away from the Java 8 JVM because of its EOL, what are they supposed to do?" - I am not sure what you are really looking for there. If people have to move away from java 8, then they have to move away from java 8. This is really no different then when folks had to move away from java 5 or any other version. We will continue to evolve our frameworks to support future versions of java, including post java 8 versions. – Jeff Scott Brown Oct 11 '18 at 14:59