How to export a .jar file that uses openCV with eclipse?
Hello there.
I have been writing java application in eclipse for some time. It creates a frame and displays some images from the webcam on it. Also it does some image processing with openCV-methods.
The application works fine in eclipse, but now i wanted to export it as a .jar file.
So i did what i always did: File > Export > Runnable JAR file. Then i selected my launch configuration (class with main method) and had to choose one of those options:
when i try to run my exported .jar now, nothing happens, no frame comes up. i have tried each of the three options above and none solved the problem.
in my project i have added the openCV-jar as userlibrary and in my main class i load it like this: System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
so summary: how do i correctly export a .jar file that uses openCV?
@StevenPuttemans i saw you responded to a similar question once, do you maybe have a solution?
I have no idea :) Probably I did a google search on my previous answer. Could it be that you have to link your openCV libraries as static libraries, so that the sourcecode gets included into your jar file? Just a guess...
@StevenPuttemans thanks for you reply mate :) http://scr.hu/1gyz/ij1p3 this is how my project structure looks like, the opencv jar and the opencv dll are in my project in ecplise. can you explain that "static libraries" aproach? i dont know how that wokrs, sorry :) also, when i export my app now and start it from the commandline with "java -jar myopencvtest.jar" then i get the following exception: http://scr.hu/1gyz/i4ceb from what i found out, this exception come up when the opencv.jar can't find its needed opencv_java246.dll. so what i tried was to put the opencv_java246.dll in my JRE bin folder, and there you go, the exported jar works just fine. though putting the dll in the local JRE bin folder is not a solution if i want to use the jar on different computers. there must be an easier
...way to bind the opencv_java246.dll with the exported jar, right?