Review Request: JDK-8181033: Confusing message: A JNI error has occurred, please check your installation and try again

David Holmes david.holmes at oracle.com
Thu May 25 07:24:06 UTC 2017


Correction ...

On 25/05/2017 5:00 PM, David Holmes wrote:
> Hi Mandy
> 
> On 25/05/2017 8:10 AM, Mandy Chung wrote:
>> http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8181033/webrev.00/
>>
>> This fixes the launcher to print the exception being thrown rather than
>> the confusing message "Error: A JNI error has occurred, please check
>> your installation and try again”.  A few attempts to improve this to
>> catch ClassNotFoundException and LinkageError.  This catches other cases.
> 
> Based on the exception stack that Volker reported this looks fine - it 
> catches the unexpected exceptions encountered during getMethod() and 
> reports them.
> 
> One thing that confuses me though, is that Volker reported the problem 
> as occurring due to verification - and he showed some VM log output to 
> support that. But verification happens when the main class is loaded! 
> The exception trace shows code that executes well after loading time. ??

Never mind. The Class.forName call requests the class not be 
initialized, which means it will not be linked. Verification is actually 
part of linking. The class has to be initialized before getMethod can be 
invoked, and hence it must first be linked and thus verified.

Thanks,
David

> Thanks,
> David
> 
>> Mandy
>>
>>


More information about the jigsaw-dev mailing list