Menu

initSevenZipFromPlatformJAR - Linux - ELF file OS ABI invalid

Help
Janek3
2021-02-11
2021-02-22
  • Janek3

    Janek3 - 2021-02-11

    Hi,

    I'm trying to load sevenzipbibding library (16.02-2.01) on Linux (CentOS 5.11; java version "1.6.0_41") and I obtain an error:

    java -jar Test7z-1.0-SNAPSHOT.jar
    net.sf.sevenzipjbinding.SevenZipNativeInitializationException: 7-Zip-JBinding initialization failed: Error loading native library: '/tmp/SevenZipJBinding-Qh9xZZgZzGj1/lib7-Zip-JBinding.so'
    at net.sf.sevenzipjbinding.SevenZip.loadNativeLibraries(SevenZip.java:650)
    at net.sf.sevenzipjbinding.SevenZip.initSevenZipFromPlatformJARIntern(SevenZip.java:456)
    at net.sf.sevenzipjbinding.SevenZip.initSevenZipFromPlatformJAR(SevenZip.java:340)
    at com.comarch.test7z.Test7z.main(Test7z.java:31)
    Caused by: java.lang.UnsatisfiedLinkError: /tmp/SevenZipJBinding-Qh9xZZgZzGj1/lib7-Zip-JBinding.so: /tmp/SevenZipJBinding-Qh9xZZgZzGj1/lib7-Zip-JBinding.so: ELF file OS ABI invalid
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1784)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.load0(Runtime.java:790)
    at java.lang.System.load(System.java:1031)
    at net.sf.sevenzipjbinding.SevenZip.loadNativeLibraries(SevenZip.java:648)
    ... 3 more

    My source code is:

        try {
            SevenZip.initSevenZipFromPlatformJAR();
            System.out.println("7-Zip-JBinding library was initialized");
        } catch (SevenZipNativeInitializationException e) {
            e.printStackTrace();
        }
    

    How can I solve my problem?

    Best regards,
    Janek

     
  • Janek3

    Janek3 - 2021-02-11

    Hello Boris,

    It's still a problem.

    java -jar Test7z-1.0-SNAPSHOT.jar
    net.sf.sevenzipjbinding.SevenZipNativeInitializationException: 7-Zip-JBinding initialization failed: Error loading native library: '/tmp/SevenZipJBinding-lHcBaRQG5OxY/lib7-Zip-JBinding.so'
    at net.sf.sevenzipjbinding.SevenZip.loadNativeLibraries(SevenZip.java:650)
    at net.sf.sevenzipjbinding.SevenZip.initSevenZipFromPlatformJARIntern(SevenZip.java:456)
    at net.sf.sevenzipjbinding.SevenZip.initSevenZipFromPlatformJAR(SevenZip.java:340)
    at com.comarch.test7z.Test7z.main(Test7z.java:30)
    Caused by: java.lang.UnsatisfiedLinkError: /tmp/SevenZipJBinding-lHcBaRQG5OxY/lib7-Zip-JBinding.so: /tmp/SevenZipJBinding-lHcBaRQG5OxY/lib7-Zip-JBinding.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1784)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.load0(Runtime.java:790)
    at java.lang.System.load(System.java:1031)
    at net.sf.sevenzipjbinding.SevenZip.loadNativeLibraries(SevenZip.java:648)
    ... 3 more

    My Linux is AMD 64.
    Is this library 32 bit?

    Best regards,
    Janek

     
  • Boris Brodski

    Boris Brodski - 2021-02-11

    Hey Janek,

    Yes, its 32 bit library. Just try 32 bit JVM on your ARM64 Linux.

    Kind regards,
    Boris

     
  • Janek3

    Janek3 - 2021-02-12

    Hello Boris,

    I have no influence on the JVM version.
    Is there possibility to build a 64 bit version of that library?

    Best regards,
    Janek

     
  • Boris Brodski

    Boris Brodski - 2021-02-12

    Hello Janek,

    I don't think, its possible. It was a test build that proved not to satisfy requirements. So the build configuration wasn't saved. I'm working on a new build process, that should produce correct binaries.

    But you can build it yourself. On your system it will be automatically correct for you. Just download the source code and build it using cmake.

    Best regards,
    Boris

     
  • Janek3

    Janek3 - 2021-02-12

    Hello Boris,

    "I'm working on a new build process, that should produce correct binaries."
    Correct binaries means binaries that will work on my environment?
    When you think, you will finish that?

    Best regards,
    Janek

     
  • Boris Brodski

    Boris Brodski - 2021-02-12

    Hello Janek,

    I between couple of month and a year. It is hard and it also depends on availability of gcc-docker images with the correct configuration. So hard to predict. I have not only this problem with the builds, but also some other problems, that all should be solved with one build. Keep in mind, that I build 7-Zip-JBinding for multiple platforms and with each release the number of platforms increases.

    Building 7-Zip-JBinding locally for only one Linux shouldn't be very easy. It has no dependencies. You just need Java, gcc and cmake. Everything is installable through apt-get. Give it a shot and I will help you doing it.

    Kind regards,
    Boris

     
  • Janek3

    Janek3 - 2021-02-12

    Hello Boris,

    Aaaa, ok. I wish you successfull on this.
    I will try to compile it on my environment. I found exact description how to do it in file "README" in chapter "6.1 Compile on Linux", so I will do it step by step.
    Thank you for your help and for all your answers.

    Best regards,
    Janek

     
  • Janek3

    Janek3 - 2021-02-15

    Hello Boris,

    I have compiled succesfully the newest version of Sevenzipjbinding 16.02-2.01-Linux-amd64 on my old Linux CentOS 5.11. Andi it is working.
    Thank you for all your help.
    If you want I could send you my builded package sevenzipjbinding-16.02-2.01-Linux-amd64.zip so it can be used for other old Linux users.

    Best regards,
    Janek

     
  • Boris Brodski

    Boris Brodski - 2021-02-22

    Hello Janek,

    I'm glad, you have a working version now! If you could send it back to me, it would be cool. I expect more people to be interested in it. You can also publish it on your own resource and I will direct other users to it. As you wish :)

    Thank you!

    Kind regards,
    Boris

     
  • Janek3

    Janek3 - 2021-02-22

    Hello Boris,

    I've attached this package to this message. I hope it can be available for you. If there is any problem I can send it to any other your e-mail address.

    Best regards,
    Janek

     

Log in to post a comment.