how do I fix an UnsatisfiedLinkError? library not found in Java.Library.Path

stfstf
edited May 2016 in Using Processing

I've put the jar file into a directory like this:
/libraries/nameofthelib/library/nameofthelib.jar

But I cant find Java.Library.Path anywhere in the Processing settings.

Anyone have any ideas how to get a library into Java.Library.Path?

I'm using a Mac.

/stf

Answers

  • edited May 2016
    • Make sure it's subfolder "libraries/" from Sketchbook location. Not Processing installation's.
    • That path is incomplete! You still need to create a folder w/ exactly the same name as the ".jar".
    • Probably "library.properties" is also needed. Dunno! :-/
    • Take a look on how other Processing libraries integrate themselves into PDE.
  • Install any contributed library through the PDE Contributions Manager you will find it in your sketch-folder/libraries this will show how the library folder is structured. You shouldn't need the library.properties file since it is used by Processing when looking for updates.

  • Install any contributed library through the PDE Contributions Manager...

    I'm assuming that library being attempted to install manually isn't available in PDE. L-)

  • I'm assuming that library being attempted to install manually isn't available in PDE

    Me too.

  • I'm assuming that library being attempted to install manually isn't available in PDE correct.

    Make sure it's subfolder "libraries/" from Sketchbook location. Not Processing installation's. Yes, the same /libraries folder containing my 50+ installed libraries.

    That path is incomplete! You still need to create a folder w/ exactly the same name as the ".jar".

    but I've created:

    /libraries/nameofthelib/library/nameofthelib.jar

    Is not /libraries/nameofthelib correct for the file nameofthelib.jar ?

  • edited May 2016

    Is not "/libraries/nameofthelib/" correct for the file "nameofthelib.jar"?

    Oops! I guess I've mixed up those library names! X_X
    Correct path: "Sketchbook"/libraries/"Name_of_Library"/library/"Name_of_Library.jar".

  • Oops! I guess I've mixed up those library names!

    Correct path: "Sketchbook"/libraries/"Name_of_Library"/library/"Name_of_Library.jar".

    Yes, the path was correct.

    Looking at the installed libraries' directory structures, I note there is most often, though not always, a /src folder in addition to the /library folder. This /src folder contains .java files. The .jar file that I have only contains .class files, I think. Relevant?

    /stf

  • edited May 2016

    This src/ folder contains ".java" files.

    Nope. Those are just source code files which still need to be compiled & compressed as 1 ".jar".

  • I'm sorry, I mis-spoke. In this case, I only have a .jar file, and IT contains only .class files. I don't actually have the .java files. I think I'm going to have to look into what the requirements are for a .jar file to work in Processing...

  • I think I'm going to have to look into what the requirements are for a .jar file to work in Processing...

    The requirements are in my 1st replay plus @quark's too.
    In short, in most cases, only the ".jar" file is needed, nothing else.

  • The source (.java) files are not needed by the Processing, only the jar file containing the .class files

    What is the name of the library, can you provide a link to the original jar file?

  • The source (.java) files are not needed by the Processing, only the jar file containing the .class files

    Ok, that is extremely helpful to know. In other words, the .java files in the /src folders found in most installed libraries are really there for the user's edification?

    The file I'm working with is named red5streaming.jar and its at https://github.com/red5pro/streaming-android/tree/master/app/libs

    Its a streaming server sdk.

    thanks for your comment!

  • edited May 2016

    That library seems to be dependent on ".so" files too.
    In those cases, the ".jar" alone won't do. But I dunno what to do on such complex arrangements.

  • That library seems to be dependent on ".so" files too....the ".jar" alone won't do.

    Ok, so at https://github.com/red5pro/streaming-android/tree/master/app/src/main/jniLibs

    are the folders: arm64-v8a, armeabi-v7a, x86

    each containing two source files: libred5android.so, libred5streaming.so

    and now I see that the entire streaming SDK is just the .jar file plus these three directories...

    can you please tell me, though, exactly how you determined the .so dependancy? can any information about the path be derived from the .jar file?

    I've tried locating the jniLibs heirarchy in /libraries/red5streaming/ a few different spots but the error persists.

    I'm trying to find another Processing library containing .so files, but haven't yet.

    I do: println(System.getProperty("java.library.path"));

    and get: :/Applications/Processing.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java

    I guess I will be looking into creating symbolic links in these directories to the jniLibs...

  • I haven't checked the contents of that ".jar". Both ".so" & ".dll" files are generally C/C++ compiled code to access the hardware.

  • GoToLoop: can you recommend a (free) tool or Eclipse plugin that will allow me to determine whether a .jar file relies on external .so files?

    And thank you for your comments!

  • I don't have Eclipse. But for comparison, take a look at Processing's video library.
    You're gonna see lotsa subfolders w/ ".dll", ".dylib" and ".so" files there.

Sign In or Register to comment.