I build application that using two external libraries the first library is opencv and the second one is swt I finished the application and it's working fine in Eclipse I change to jar file it doesn't work then I change the loaded function jar file from:
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
to
System.load("/Users/AbdallahRizk/Documents/opencv/opencv-2.4.11/build/lib/libopencv_java2411.dylib");
Note: I'm using mac operating system.
and I export the jar file again and I use the command:
java -XstartOnFirstThread -jar here.jar
because I apply swt library. And the jar file work perfect in my laptop. But once I tried it in the operating system such as ubuntu and windows it doesn't work and I received the following error:
I know that in windows no need for -XstartOnFirstThread but I tried both but I still receiving the same error. I haven't try it yet in another mac operating system but I'm sure it won't work because the loaded opencv library won't be available so I'm trying to packed all the external libraries inside my jar file to work dependently in ubuntu and windows and mac os x.
Based on my research there is a way to do it using maven. Right now I'm using normal eclipse project so any suggestion how to use eclipse to create maven project and export jar file with all the libraries packed inside?