Java 1.8 Asm Classreader Failed to Parse Class File - Probably Due to a New Java Class File Version That Isn't Supported Yet

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

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.

ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported - Am using Apache 7 and JDK 1.8

You are using a version of Spring that depends on a version of ASM that doesn't support code compiled with Java 8 compilers. You need to upgrade to Spring 4.0.3 or later.

https://spring.io/blog/2014/03/27/spring-framework-4-0-3-released-with-java-8-support-now-production-ready

You might get away with doing a point update of the ASM library, but that is liable to introduce compatibility problems between Spring and ASM. Upgrading Spring is a better idea. You get the opportunity to use the new features in Spring 4.x, and migration to 5.x and beyond is easier.


Someone suggested an alternative approach: roll back your runtime and build platforms to Java 7. That may work in the short term, but you are just putting off upgrading .... and making the upgrades a bigger problem to solve when you are forced to solve them.


Apparently, you can also get this if you are using a mixture of Spring versions, presumably some of them older than Spring 4.0.3, with Java 8 and later.

Tomcat 7 with MySQL connector: ASM ClassReader failed to parse class file

Switching to mysql-connector-java-5.0.8-bin.jar from the "Previous GA" section solved the issue.
https://dev.mysql.com/downloads/connector/j/5.0.html



Related Topics



Leave a reply



Submit