Bug 537678

Summary: Compile error: NoClassDefFoundError thrown: Could not initialize class org.aspectj.weaver.bcel.ClassPathManager$JImageEntry
Product: [Tools] AspectJ Reporter: Dmitriy Kosolobov <dima>
Component: CompilerAssignee: aspectj inbox <aspectj-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aclement, dima, stephan.herrmann, vasili.gulevich
Version: unspecified   
Target Milestone: 1.9.2   
Hardware: PC   
OS: All   
Whiteboard:

Description Dmitriy Kosolobov CLA 2018-08-03 14:32:24 EDT
I get such error when I try to do something in my roo project

java.lang.NoClassDefFoundError
at org.aspectj.weaver.bcel.ClassPathManager.addPath(ClassPathManager.java:110)
at org.aspectj.weaver.bcel.ClassPathManager.<init>(ClassPathManager.java:84)
at org.aspectj.weaver.bcel.BcelWorld.<init>(BcelWorld.java:285)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.initBcelWorld(AjBuildManager.java:841)
at org.aspectj.ajdt.internal.core.builder.AjBuildManager.performBuild(AjBuildManager.java:253 ... ker.run(Worker.java:60)

Compile error: NoClassDefFoundError thrown: Could not initialize class org.aspectj.weaver.bcel.ClassPathManager$JImageEntry
Comment 1 Vasili Gulevich CLA 2018-08-06 06:56:44 EDT
Happens on Linux when trying to build Eclipse plugins of RCPTT Runtime.
Comment 2 Andrew Clement CLA 2018-08-24 21:05:55 EDT
Are you possibly passing a classpath with a jrt-fs.jar entry when working on a JDK less than 9?  I can imagine that would cause this. Rather then ignoring jrt-fs.jar we assume you passed it because you are working on Java9+ and attempt to use the JDK to work with it - if the JDK is in fact Java8 or lower we will not find those JDK classes and I think that could cause initialization problems in JImageEntry.
Comment 3 Andrew Clement CLA 2018-10-11 14:22:02 EDT
Actually I see what could be happening here, it is perhaps because the filesystem initialization is done in static initialization of the class rather than when actually required. Changed it around.