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

Mandy Chung mandy.chung at
Thu May 25 17:25:20 UTC 2017

> On May 25, 2017, at 12:24 AM, David Holmes <david.holmes at> wrote:
> Correction ...
> On 25/05/2017 5:00 PM, David Holmes wrote:
>> Hi Mandy
>> On 25/05/2017 8:10 AM, Mandy Chung wrote:
>>> 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.

Yes exactly.  FWIW [1][2] are references to linking and initialization.


More information about the jigsaw-dev mailing list