Community
Participate
Working Groups
Error while compiling the gradle project - Exception thrown from AspectJ org.aspectj.apache.bcel.classfile.ClassFormatException at org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:192) at org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:131) at org.aspectj.weaver.bcel.BcelWeaver.addAspectsFromJarFile(BcelWeaver.java:263) at org.aspectj.weaver.bcel.BcelWeaver.addLibraryJarFile(BcelWeaver.java:239) at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initB ... ternal.jobs.Worker.run(Worker.java:56) Compile error: ClassFormatException thrown: File: 'module-info.class': Invalid byte tag in constant pool: 19
Created attachment 280883 [details] Error dialog in Eclipse workspace while trying to build the gradle project
Which AJDT are you using? Is it the one from http://download.eclipse.org/tools/ajdt/410/dev/update ? And what version of Java is the project you are working on? It looks like you are using an older AJDT that doesn't support the version of Java you have. module-info.class will be using byte tag 19 to represent the module object and that should be fine with recent AspectJs.
I could move forward using the Eclipse Oxygen version with OpenJDK 1.8.0_222. The 2.10.1 Jackson was recently released for Java 9 projects with in my company, that created the issue. This Java 9 module is apparently not compatible with the AspectJ compiler in Eclipse version.
I think it is worth me clarifying that the version of AJDT on http://download.eclipse.org/tools/ajdt/410/dev/update is for any recent version of Eclipse, not just 4.10 and is the only way to get a version of AJDT that includes a modern AspectJ build. I haven't put 1.9.5 in there yet (the java13 supporting version) but it does include 1.9.4 which supports Java12, and should support the module system from Java9 just fine.