Java - "A JNI Error has occurred" for one instance of the program, not for another
I made a large program in Eclipse Java Mars on one computer which worked fine. I exported the program as a runable Jar-file and running it gave no problem whatsoever. Even when I exported the entire project to another computer, the program still works.
The issue came forth on the other computer when I made minor changes to the project. These changes were only content based changes and should make no difference on the functionality of the program. Running the program from eclipse appears to have no problems. However, when I want to run the newly created Jar-file I get the following error:
Error: A JNI error has occurred, please check your installation and try again.
followed by a frame saying:
A Java Exception has occurred.
So my question is:
How is it possible that a different instances of the same program cannot run via a Jar-file, while the older instance can?
I used the same JDK version (1.8.0_73) on both computers, and installed them in pretty much the same way: I first installed Java together with NetBeans via a combined release. Following, I installed Eclipse. The only difference is that on the new computer I installed eclipse offline, i.e. without the Eclipse installer
There are 4 suggested solutions here and each one has been listed below with a detailed description. The following topics have been covered briefly such as Compiler Errors, Java, Eclipse, Java 8, Java Native Interface. These have been categorized in sections for a clear and precise explanation.