RFR [9] 8139297: java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.jimage.ImageNativeSubstrate

Mandy Chung mandy.chung at oracle.com
Fri Oct 9 21:16:30 UTC 2015


On 10/09/2015 12:37 PM, Alan Bateman wrote:
>
> On 09/10/2015 20:26, Jim Laskey (Oracle) wrote:
>> "it should never attempt to use the native implementation”  This is 
>> confusing.  It’s attempting to see if a native library is present 
>> otherwise use java.  Is this the wrong approach?
>>
>>
> jrtfs should use the native implementation when targeting the current 
> runtime of course.
>
> However, when the target runtime is different then the safest is to 
> use the pure-java implementation. I think this will become more 
> obvious when jrtfs is updated to work on JDK 9 but targeting a 
> different JDK 9 build.

I also think it's a better approach for jrtfs to use pure-java 
implementation when targetting a different runtime.  Perhaps you can add 
a method SystemImages::isCurrentRuntime (something like that) that 
BasicImageReader can use to determine if it should use 
ImageNativeSubstrate or ImageJavaSubstrate.

Mandy




More information about the core-libs-dev mailing list