ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

question about absolute path

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • question about absolute path

    Hello,

    Im trying to load some software using System.load("/ty/chilkat.so").

    But their support is saying my absolute path is wrong. But this is the path from root("/ty").

    This is also where Im storing my java program to run the system.load.

    /ty/ChilkatExample.class

    Is my absolute path incorrect?

    Here is the java code that loads the .so code


    import com.chilkatsoft.*;

    public class ChilkatExample {

    static {
    try {
    System.load("/ty/libchilkat.so");
    } catch (UnsatisfiedLinkError e) {
    System.err.println("Native code library failed to load.\n" + e);
    System.exit(1);
    }
    }

  • #2
    Re: question about absolute path

    Do you have a file named /ty/libchilkat.so in the IFS?

    Comment


    • #3
      Re: question about absolute path

      Yes.

      I believe it's finding it, but not loading the code ...

      Nothing Ive tried has worked. 32/64 bit run times, nothing. Im grasping at straws now ...

      Comment


      • #4
        Re: question about absolute path

        Can you post the exact error message?

        Comment


        • #5
          Re: question about absolute path

          Code:
          java ChilkatExample                                                          
           Native code library failed to load.                                          
           java.lang.UnsatisfiedLinkError: /ty/libchilkat.so (     0509-022 Cannot load 
           module /ty/libchilkat.so.                                                    
                   0509-021 Additional errors occurred but are not reported.)
          Is there a way to get it to display all the errors?



          This is the java code that generated the error

          Code:
          import com.chilkatsoft.*;
          
          public class ChilkatExample {
          
            static {
              try {
                  System.load("/ty/libchilkat.so");
              } catch (UnsatisfiedLinkError e) {
                System.err.println("Native code library failed to load.\n" + e);
                System.exit(1);
              }
            }
          Im using the below JVM

          Name . . . . . . . . . : JAVA_HOME

          Value . . . . . . . . . : '/QOpenSys/QIBM/ProdData/JavaVM/jdk60/64bit'

          Comment


          • #6
            Re: question about absolute path

            So it doesn't say anything about the path not being found, etc. It just says that it can't load the library...

            Is it possible that this is not a valid library for some reason? Maybe it got changed during file transfer? Or maybe it was compiled for a different operating system (Linux, perhaps?)

            Comment


            • #7
              Re: question about absolute path

              It is supposed to be complied for the power(6-7-8). Im thinking that it's not valid and the 400 is rejecting it.

              I think your right.

              Comment


              • #8
                Re: question about absolute path

                Thank You for your help with this. I just got an email from him saying that he was not compiling on the i5, but something called PowerLinux.

                The code is written in C/C++ and he's just using java wrappers and native JNI to accomplish what he's trying to do ...

                If you know of any way around this, please let me know...

                Comment


                • #9
                  Re: question about absolute path

                  You can use it in Java if it's compiled for AIX. But, not PowerLinux. It must either be AIX (in which case it'll be an '.so' file in the IFS) or for IBM i (in which case it'll be a *SRVPGM object in a library.) So either of those environments will work... but not a Linux environment.

                  Comment


                  • #10
                    Re: question about absolute path

                    Thanx again Scott

                    Comment

                    Working...
                    X