I have made JavaFX Project with using Opencv 3.1 Java library in it.
The thing is that my project runs completely perfect from the IDE but when I try to run the .jar
file from the dist
folder it throws the unsatisfied link error.
I searched about this problem already and found many answers but none solved mine.I think may be those solutions are for older versions.
My Main Method is as follows :-
public static void main(String[] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
launch(args);
}
I have also set the library path correctly :
and also have the .dll file in the specified location
The App runs completely as expected if I run from IDE !
PS: I also tried to put the project in Eclipse and try creating jar but same thing happens, it runs in IDE but not when I run the jar
Error details :
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: no opencv_java310 in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.Rein.rteapp.MainApp.main(MainApp.java:129)