I know Java 11 has not been officially released yet, but has anyone tested Grails 3.x with an early access release of Java 11? Or does anyone know when or if Grails 3.x will support Java 11?
Well I know that the support for Java 9+ in Groovy is getting worked on and I think 2.5.2 had some fixes. Technically Groovy will work on newer versions of java, but you'll get a bunch of warnings. All of this is supposed to be worked out for Groovy 3.0, probably coming around the end of the year, based on what I hear at GR8Con.US.
All that being said, Grails 3.3 is on Groovy 2.4.x, with spring boot 1.2, which I don't think either support newer versions of Java. Grails 4 is supposed to be coming out by the end of the year, with Groovy 2.5, and a newer version of spring boot. Once Groovy 3 comes out it shouldn't be too long before Grails upgrades to it.
Also check out the Groovy Podcast, there was a metion on the support from Groovy:
https://youtu.be/XQLblr2OGJ8
I know Java 11 has not been officially released yet, but has anyone
tested Grails 3.x with an early access release of Java 11?
I tried using Grails 3.3.8 and the early access release of JDK 11 and it didn't work, but I wondered if that might be something to do with the JDK.
Then I tried again using Oracle's official release of JDK 11 which came out a couple of days ago. I rebuilt an existing Grails project in NetBeans 9.0 using JDK 11 / Grails 3.3.8, and got the following error:
Command [clean] error: Could not determine java version from '11'. (Use --stacktrace to see the full trace)
I get similar errors when using JDK 9 and 10, but the project builds and runs fine using JDK 8.
See this SO answer for a similar problem when using Grails with JDK 10: Could not determine java version from '10.0.2' while starting Grails 3.3.8 application:
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.
Or does anyone know when or if Grails 3.x will support Java 11?
Grails 3.x won't ever support JDK 11 according to a Grails developer. See the comments for the SO answer I linked to above:
You have to wait for Grails 4 to use a JDK > 8.
I don't know anything about a proposed release date for Grails 4.
Java 11 is supported in Grails 4. However, note Grails 4 still builds on Groovy 2.5.x which doesn't run all that smooth on Java 9-11 compared to Groovy 3. So warnings and stuff like that is to be expected.
//EDIT 22/01/2022: Grails 5 is build is built on Groovy 3.0.x and therefore works smoothly with Java 11.
Related
I have a project currently in grails 2.5.x and upgrading to grails 3.0.17.
Grails 2.5.x is being compiled on Java 11 (Didn't found any official Support).
Grails 3.0.17 when compiled(the same project after upgrading) give error that it doesnt support Java 11 (didn't got the logic why)
I found some pages where it says grails 3.0.17 uses gradle 2.4 and groovy 2.x which doesnt support Java 11 but makes no sense that it gets compiled on grails 2.5.x, a older version.
Grails 2, and 3 does not officially support Java 11. You need to update to Grails 4 to get Java 11 support.
At the moment we work with SonarQube 6.6. The reason is that something did not work correct with newer versions of SonarQube and they did not want to investigate this.
But it turns out that SonarQube 6.6 only partly works with Java 11. It seems to work, until you want to login. To login in SonarQube you need to use Java 8.
The latest version of SonarQube is 7.4. Would this version of SonarQube work with Java 11? Then maybe we should upgrade and fix the problems.
In the SonarCube 7.4. documentation, they clearly state that Java 8 is required to run SonarCube 7.4.
See also:
Java Runtime Engine support for SonarQube 7.x
which mentions that one roadblock has been a version of ElasticSearch for Java 11. Another issue seems to be that they were not keen to put effort into supporting Java 9 and 10, given that they were only going to be supported for 6 months each.
My web application runs fine on JDK 1.7 but crashes on 1.8 with the following exception (during application server startup with Jetty 8). I am using Spring version: 3.2.5.RELEASE.
Exception:
org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet
I assume that problem occurs because of spring and "asm.jar" library on which it depends.
How do I resolve this?
As #prunge and #Pablo Lozano stated, you need Spring 4 if you want compile code to Java 8 (--target 1.8), but you can still run apps on Java 8 compiled to Java 7 if you run on Spring 3.2.X.
Check out
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/new-in-4.0.html
Note that the Java 8 bytecode level (-target 1.8, as required by -source 1.8) is only fully supported as of Spring Framework 4.0. In particular, Spring 3.2 based applications need to be compiled with a maximum of Java 7 as the target, even if they happen to be deployed onto a Java 8 runtime. Please upgrade to Spring 4 for Java 8 based applications.
If you encounter this error even if you compile with -target 1.7, please note that this is because of a bug in Spring Framework which causes ASM classreader to load jdk classes (java.* or javax.*), which are, of course, compiled with -target 1.8.
This, combined with the old ASM version in spring 3.2.8 and below, which does not support parsing of 1.8 class files, can also lead to this error.
More info about the issue can be found here: https://jira.spring.io/browse/SPR-11719
This should be fixed in Spring Framework version 3.2.9, which is due to be released soon.
Of course, upgrading to Spring Framework 4 will also resolve the issue, as it already contains a newer version of ASM.
However, if for some reason you can't upgrade to version 4 yet, it's good to know there's an alternative (soon).
I had the same problem and solved it. I am using spring 3.x with java 8. If above solutions are not working change the jars and search whether those jars are compatible with the java version you are using or not. spring 3.x is not compatible with java 8.
I had the same problem,
1.Go to:
maven -> executive maven goal -> mvn clean
It helps :)
2.Invalid caches..
This problem might because of wrong selection of environments. I tried changing JRE to Java SE 1.8 which is the Java version installed.
Project>>Right click>>Properties>>Java Build Path>>Libraries>>Double click JRE system Library>>Execution Environment to JAVA VERSION INSTALLED.
if you use java 8 or next version you need to upgrade spring version and spring version should be 4.xxx
Spring 4 can be used for java 8 to resolve this issue. I just tested it and it works.
This issue is fixed since Spring 3.2.9-RELEASE version.
I have a old project running in java 6 and am trying to implement sso using onelogin's javasaml library. I see the java-saml-core and java-saml dependencies compiled with higher versions. I also see that in the github that it is compatable with java 6,7 and 8. What does it mean? May i use the libraries as it is to develop my solution in java6 project? any thoughts? thank you!
https://github.com/onelogin/java-saml
Version 2.X of java-saml was originally designed to be compatible with Java 6,7 and 8.
but in the road we introduced some incompatibilities with Java 6 that we described on that github issue
Just in case someone is interested, I managed to recompile java-saml under Java 6 to run on an old WebSphere instance.
Changes are limited to a few Java 7 specific syntax (diamonds, multi catch, closeable)
Fork is available at: https://github.com/mguessan/java-saml
My web application runs fine on JDK 1.7 but crashes on 1.8 with the following exception (during application server startup with Jetty 8). I am using Spring version: 3.2.5.RELEASE.
Exception:
org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet
I assume that problem occurs because of spring and "asm.jar" library on which it depends.
How do I resolve this?
As #prunge and #Pablo Lozano stated, you need Spring 4 if you want compile code to Java 8 (--target 1.8), but you can still run apps on Java 8 compiled to Java 7 if you run on Spring 3.2.X.
Check out
http://docs.spring.io/spring/docs/current/spring-framework-reference/html/new-in-4.0.html
Note that the Java 8 bytecode level (-target 1.8, as required by -source 1.8) is only fully supported as of Spring Framework 4.0. In particular, Spring 3.2 based applications need to be compiled with a maximum of Java 7 as the target, even if they happen to be deployed onto a Java 8 runtime. Please upgrade to Spring 4 for Java 8 based applications.
If you encounter this error even if you compile with -target 1.7, please note that this is because of a bug in Spring Framework which causes ASM classreader to load jdk classes (java.* or javax.*), which are, of course, compiled with -target 1.8.
This, combined with the old ASM version in spring 3.2.8 and below, which does not support parsing of 1.8 class files, can also lead to this error.
More info about the issue can be found here: https://jira.spring.io/browse/SPR-11719
This should be fixed in Spring Framework version 3.2.9, which is due to be released soon.
Of course, upgrading to Spring Framework 4 will also resolve the issue, as it already contains a newer version of ASM.
However, if for some reason you can't upgrade to version 4 yet, it's good to know there's an alternative (soon).
I had the same problem and solved it. I am using spring 3.x with java 8. If above solutions are not working change the jars and search whether those jars are compatible with the java version you are using or not. spring 3.x is not compatible with java 8.
I had the same problem,
1.Go to:
maven -> executive maven goal -> mvn clean
It helps :)
2.Invalid caches..
This problem might because of wrong selection of environments. I tried changing JRE to Java SE 1.8 which is the Java version installed.
Project>>Right click>>Properties>>Java Build Path>>Libraries>>Double click JRE system Library>>Execution Environment to JAVA VERSION INSTALLED.
if you use java 8 or next version you need to upgrade spring version and spring version should be 4.xxx
Spring 4 can be used for java 8 to resolve this issue. I just tested it and it works.
This issue is fixed since Spring 3.2.9-RELEASE version.