Can I run spring boot 1.4.x jar on java 11+? - java

I searched spring documentation and the release notes. The details provided are more towards development with a specific version. But these documentation fails to mention if the old jars can be run against new java versions.
Does anyone have any idea if spring boot 1.4.x application compiled and built on java 8 would run on java 11+.?

No.
Spring Boot 1.4 is using Spring Framework 4.3
which does not support Java (JRE) 11
https://endoflife.date/spring-framework

Related

Grails 3.x and 2.5.x and java 11 compatibility issue

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.

How to use OpenJDK 8 in Spring MVC application instead of Oracle JDK 1.8?

I have developed a Spring MVC Application using the below tools and technologies and it is working fine without any issue.
Spring Framework (Core, MVC & JDBC) 4.2.5.RELEASE
Java 1.8
Maven 3.3.9
Eclipse IDE (Neon 2. Release 4.6.2)
Oracle JDBC - ojdbc6 Version: 11.2.0.3
Now, I want to use OpenJDK-8 instead of Oracle JDK-8. How can we use OpenJDK in Spring MVC Project?
You just need to install OpenJDK on machines, where you want to build and run your projects, set JAVA_HOME to point to OpenJDK and that's it. Same for IDEs (Eclipse).
No need to change maven config since java version is not really depends on JDK vendor.

Does Grails 3.x support Java 11

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.

Apache CXF auto-discovery feature configuration error [duplicate]

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.

Java 1.8 ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet

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.

Categories