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

Source: Internet
Author: User

error Condition: due to changes in the interface, an externally dependent jar package was updated in the project, and the following issues were encountered after the compilation was started:

class New
class file version that isn ' t supported Yet:url [jar:file:/d:/project/extra-v20171116/extra/extra-interfaces /target/
extra/web-inf/lib/seat-api-1.0.jar!/com/csair/extra/seat/controller/paramswrapper/ Flightchangereqparam. class];
Nested exception is java.lang.IllegalArgumentException

Troubleshooting: According to the probably due to a new Java class file version of that isn ' t supported yet this message, it may feel like a JDK match.

Then I looked at the JDK version that was used for project engineering. ----in the project's Pom file

<!--maven compiled version using jdk1.7--><plugin><artifactid>maven-compiler-plugin</artifactid>< version>3.1</version><configuration><source>1.7</source><target>1.7</ Target><encoding>utf-8</encoding></configuration></plugin>

Then look at the compiled version of the Flightchangereqparam.class for the error in the jar package. By holding down the CTRL key through idea, the idea will directly help us decompile.

You can see that this is compiled under the jdk1.8 version. So it does not match the current project. Should just re-hit a 1.7 version of the jar package will not be an error.

Try to find a deeper reason on the Internet.

If you encounter this error even if you compile With-target 1.7, please note the This is because of a bug in Spring Fram Ework

leads to this error. This should was fixed in Spring Framework version 3.2.9, which are due to be released soon. Of course, upgrading to Spring Framework 4 would also resolve the issue, as it already contains a newer version of ASM.

Reason: so it is Spring3.2. Version 8 and the following does not support the compilation version of the jar package JDK1.8. If you want to use the 1.8 version of the jar package, then you have to update to spring 4.

Or only a jar package with a compiled version of JDK1.7 is used entirely.

Summary: There is also a need to note that the compilation and operation is two separate actions. That is, compiling and running can use different versions of the JDK.

However, it is important to note that the version of the JDK running is not less than the version at compile time.

This is because I have a JDK version of 1.8 in idea, but I can run this project before. This is not going to affect the project.

Since this is a big project, there are many people to develop together, so the configuration must be stable, so this situation can only be rebuilt to the class file to compile.

The next time in the introduction of someone else's package is to be cautious, a little attention, the subsequent troubleshooting, the change is very time-consuming. However, in the pre-professional accumulation of errors, and then see the error until the "remedy".

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.