Short issue
I've been porting a JavaFX application to java 11. And after many hurdles I ran across the issue of : When I start the jar by double clicking it , it returns a JNI error. But when running it through console it works. How can I make it work when double clicked
Prerequisites
After looking up this issue on google , the results I found are summed up in A JNI error has occurred, please check your installation and try again in Eclipse x86 Windows 8.1
It recommends checking the java
and javac
versions, if they do not return the same java version then reinstall java on the pc.
PS C:\Users\nolookielookie> java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
PS C:\Users\nolookielookie> javac -version
javac 11
They return the same version.
Also you can see the installed java version here, keep in mind i also have java 8 installed to support some legacy business applications.
More explanation of the issue
When double-clicking the java app (windows 10) it gives this popup. popup that appears
But when running the application through the command prompt. it works IT JUST WORKS FROM THE COMMAND PROMPT.
Screenshots : https://i.stack.imgur.com/wmtAB.jpg