loading native libraries with java webstart

Discussion in 'Java' started by weiss.matt@gmail.com, May 10, 2006.

  1. Guest

    Hi All,

    I'm hoping someone in the Mac/Java community can give me a bit of help
    with a native library problem I'm having. I've been doing Mac
    development for about 2 years now and I've faced the "unsatisfied link
    error" problem and I've learned how to overcome it. At first, I
    changed my DYLD_LIBRARY_PATH to include my dylibs. This worked, but
    was a little clumsy. I then discovered that install_name_tool could
    change my library dependency paths to point explicitely to my dependent
    dylibs, or relatively with the @executable_path decorator.

    All was well, then came Java Webstart :(

    >From what little I've learned, I need to put all of my native libraries


    in a jar, and sign it of course, then include this jar in my classpath.
    In any case I still get a "unsatisfied link error" I have 2
    libraries, one is the jnilib and one is a dylib if I do an otool -L on
    the jnilib it looks like this:

    libXDSIII.jnilib (compatibility version 1.0.0, current version1.0.0)
    libXDSIII.dylib (compatibility version 1.0.0, current version1.0.0)
    /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
    (compatibility version 1.0.0, current version 82.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    (compatibility version 150.0.0, current version 368.26.0)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0,current version
    7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
    1.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
    version 88.1.3)

    if I do an otool -L on the dylib, it looks like this:

    libXDSIII.dylib (compatibility version 1.0.0, current version1.0.0)
    /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
    (compatibility version 1.0.0, current version 275.0.0)
    /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    (compatibility version 150.0.0, current version 368.26.0)
    /System/Library/Frameworks/JavaVM.framework/Versions/A/JavaVM
    (compatibility version 1.0.0, current version 82.0.0)

    /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
    (compatibility version 1.0.0, current version 18.0.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,current version
    88.1.3)
    /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0,
    current version 7.4.0)
    /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
    1.0.0)

    These were compiled with the -dynamic linker flag, thus including a
    reference to themselves. In any case, I believe the jnilib is unable
    to load the dylib because of the console output. Can anyone help me?
    What should the java.library.path be set to on the jnilib and the
    dylib?
    Should it just be relative? does the jar that loads the jnilib need to
    be at the same package level? Mine wasn't then I changed it, but it
    still didn't help.

    I do have the static code block that does a LoadLibrary on the XDSIII
    library. And I have successfully used the same java code in a
    non-webstart application before. I believe the only variable that I
    need to adjust is the library paths, but that's just a hunch.

    Please advise.

    Thanks in advance,
    Matt
    , May 10, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Thompson

    Re: Webstart & Loading ImageIcons?

    Andrew Thompson, Jul 7, 2003, in forum: Java
    Replies:
    0
    Views:
    406
    Andrew Thompson
    Jul 7, 2003
  2. Alex Hunsley
    Replies:
    4
    Views:
    878
    Alex Hunsley
    Nov 14, 2003
  3. Replies:
    16
    Views:
    1,011
    Chris Uppal
    Apr 6, 2006
  4. Karsten Wutzke
    Replies:
    21
    Views:
    907
    Roedy Green
    Jun 29, 2007
  5. Andi
    Replies:
    3
    Views:
    431
    Andrew Thompson
    Aug 4, 2008
Loading...

Share This Page