0

I want to do add a .so file to my project. Currently I have my .so file on my desktop in a folder with the Eclipse environment pointed to it like so:

class folders on buildpath

As you can see my native source item is pointing to the correct location, but I am getting an UnsatisfiedLinkError.

This is how my class path looks when I print it out:

/correct-path/opencv-2.4.9/build/lib:/correct-path/facerec
Raedwald
  • 46,613
  • 43
  • 151
  • 237
user3238439
  • 49
  • 1
  • 5
  • Native libraries have to go in the [`LD_LIBRARY_PATH`](http://stackoverflow.com/q/6666696/2970947); not the `CLASSPATH`. – Elliott Frisch Jun 24 '14 at 15:17
  • @ElliottFrisch I've added this to my eclipse.ini `-Djava.library.path="/correct-path/facerec"` is this correct? It hasn't mad a difference. – user3238439 Jun 24 '14 at 15:24
  • @ElliottFrisch Afraid that didn't work... – user3238439 Jun 24 '14 at 15:33
  • @user3238439 Double check that the library has the same bitness as Java. That is, if the library is 32-bit, make sure the JRE is not 64-bit, or vice versa. – martinez314 Jun 24 '14 at 16:07
  • @user3238439 The setting should not go in eclipse.ini, but in your Run Configuration under the Arguments tab, in the "VM arguments" area. When you run an application a new JVM is spawned which needs your library path. – Adrian Pang Jun 24 '14 at 17:50

0 Answers0