JDK-8181033 : Confusing message: A JNI error has occurred, please check your installation and try again
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2017-05-24
  • Updated: 2019-03-23
  • Resolved: 2017-05-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 9
10Fixed 9 b172Fixed
Related Reports
Relates :  
Relates :  
Description
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.security.AccessControlException:
access denied ("java.lang.RuntimePermission"
"accessClassInPackage.com.sun.crypto.provider")

java launcher outputs "Error: A JNI error has occurred, please check your installation and try again", very confusing message.  A few attempts to improve this to catch ClassNotFoundException and LinkageError.   

See example test in [1]

[1] http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-May/012765.html
Comments
This is approved for JDK 9 as the confusing "JNI error" message occurs in more cases with JDK 9 when compared to JDK 8 and people are complaining about it.
25-05-2017

JDK 9 Fix Request: Long standing confusing message emitted by the launcher. This is a simple low risk fix to improve the error message.
24-05-2017