4

Recently upgraded a large project from Java 11 to 13. I am using AspectJ for logging purposes and I am now getting this error on startup :

AspectJ Internal Error: unable to add stackmap attributes. Unsupported class file major version 57

Looks clear as day that Java 13 is not supported and looking at the AspectJ site they mention Java 12 support added in version 1.9.3 but as of the latest one, 1.9.4, still no mention of Java 13 support.

Any idea if there is a way around this or if the project will be updated again soon? The last release was in May...

UPDATE

As requested, here are my dependency declarations :

<dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-instrument</artifactId>
    </dependency>

And here are my Java Agent declarations :

-javaagent:lib/aspectjweaver-1.9.4.jar -javaagent:lib/spring-instrument-5.2.0.RELEASE.jar

Thanks

Martin
  • 1,977
  • 5
  • 30
  • 67
  • Why don't you ask at the soure of `AspectJ`? https://www.eclipse.org/org/foundation/contact.php – tryingHard Oct 17 '19 at 13:20
  • Upgrading large projects to the bleeding edge, then wondering when things break? – Kayaman Oct 17 '19 at 13:35
  • @Kayaman right? haha no worries it's a personal project of mine and i figured i would upgrade java version at the same time as spring boot 2.2 since it's officially compatible now. Again it's just for logging so worst case i'll just turn it off for now. – Martin Oct 17 '19 at 13:37
  • Since you have Spring Boot, note that Spring in general announced support for 13 only since yet-unreleased version 5.2. – M. Prokhorov Oct 17 '19 at 14:29
  • 5.2.0 is released in GA from what i can tell from the Spring Boot 2.2 release notes and Maven central – Martin Oct 17 '19 at 14:37
  • 1
    @M.Prokhorov Spring boot `2.2.0` is already GA and [extends support to Java-14](https://stackoverflow.com/a/58357113/1746118), that included 5.2.0 from their release candidates itself. – Naman Oct 17 '19 at 14:44
  • @Naman, that means they must've solved this problem, since they also depend on AJ. So the issue should be solved by upgrading, but OP also says he upgraded to 2.2.0 and still has it(?). – M. Prokhorov Oct 17 '19 at 14:49
  • Well, yeah which brings me to the question @Martin can you share the dependency for `aspectJ` that you are using explicitly? (if) plugin as well? – Naman Oct 17 '19 at 14:52
  • updated original post – Martin Oct 17 '19 at 14:58
  • 1.9.5 dropped a few days ago. Still getting the same error : AspectJ Internal Error: unable to add stackmap attributes. Unsupported class file major version 57 – Martin Dec 05 '19 at 02:59

1 Answers1

1

AspectJ 1.9.5 just dropped with official Java 13 support. Spring Boot 2.2.1 still has the 1.9.4 dependency (will probably be updated in 2.2.2) so for now you have to specify an override version in the POM.xml file :

<dependency>
    <groupId>org.aspectj</groupId>
    <artifactId>aspectjweaver</artifactId>
    <version>1.9.5</version><!--$NO-MVN-MAN-VER$-->
</dependency>
Martin
  • 1,977
  • 5
  • 30
  • 67