Bug 537678 - Compile error: NoClassDefFoundError thrown: Could not initialize class org.aspectj.weaver.bcel.ClassPathManager$JImageEntry
Summary: Compile error: NoClassDefFoundError thrown: Could not initialize class org.as...
Status: RESOLVED FIXED
Alias: None
Product: AspectJ
Classification: Tools
Component: Compiler (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: 1.9.2   Edit
Assignee: aspectj inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-03 14:32 EDT by Dmitriy Kosolobov CLA
Modified: 2018-10-11 14:22 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.