0

Sorry but I not Have a solution for my problem. Can you help me?

I have an application on Eclipse and it work correctly with openCV, but if export it in a jar executable jar, I have the error from the command prompt when launching the jar:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java249 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 grafic.WindowInterface.windowsValidate(WindowInterface.java:695)
    at grafic.WindowInterface.validate(WindowInterface.java:677)
    at grafic.WindowInterface$4.widgetSelected(WindowInterface.java:388)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:248)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4169)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3758)
    at grafic.WindowInterface.open(WindowInterface.java:122)
    at grafic.WindowInterface$1.run(WindowInterface.java:105)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at grafic.WindowInterface.main(WindowInterface.java:101)
  • I have intalled the open CV(2.4.9) from this tutorial.

  • I have added on Windows sistem path this variable :

    C:\Program Files\Java\opencv\build\x86\vc10\bin;

  • I have create the executable jar as in this tutorial.

Have you suggestions?Why the application work correctly on eclipse and not work in the executable jar?

Thanks for help.

user3675796
  • 23
  • 1
  • 6
  • From previous discussion, you mentioned this is your library: C:\Program Files\Java\opencv\build\java\opencv_java249.jar. Can you verify it's actually been included in the JAR that you packaged? – Ryan J May 29 '14 at 20:50
  • I do not know how to do – user3675796 May 29 '14 at 20:53
  • My java.library.path is : C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:\Program Files\Java\apache-tomcat-6.0.18\bin;C:\Program Files\Java\sdk\tools;C:\Program Files\Java\sdk\platform-tools;C:\Program Files\Java\jdk1.7.0_25\bin;;C:\Program Files\Java\eclipse – user3675796 May 29 '14 at 20:55

2 Answers2

0

Sorry, I dont't have solutions.

I must pack my openCV.jar library into an executable java project .jar.

user3675796
  • 23
  • 1
  • 6
0

I had the same problem.

It happened because I had a mistake with the 'Native library location' configuration:

Goto Eclipse -> Window -> Preferences:

Goto Eclipse -> Window -> Preferences

Goto User Libraries:

enter image description here

Make sure that your native library location path is (change c:/opencv-2.4.9 to your own opencv folder):

C:/opencv-2.4.9/build/java/x64

and not:

C:/opencv-2.4.9/build/x64

(I missed the /java folder...)

Avi L
  • 1,558
  • 2
  • 15
  • 33