I am very green on Java and JNA, please be patient if nomenclature is wrong.
- Fails with JNA 4.5.1
- Works with JNA 4.5.0
- Ubuntu 14 LTS
- 32 bit i.MX6 ARMv7l (armhf, hard float)
- Can be reprodued with "Hello world" from this repo, https://github.com/java-native-access/jna/blob/4.5.1. /www/GettingStarted.md
- Compile with maven, downloads JNA via "net.java.dev.jna". Create a jar-with-dependencies, libjnidispatch.so exists for 30 something arhitectures.
- Same result independent on what I compile with (Oracle or OpenJDK). OpenJDK can always run the jar, Oracle always fails.
- No issues with OpenJDK Java 8
- Fails with Oracle Java 8:
$ java -XshowSettings:properties -version
...
sun.arch.abi = gnueabihf
...
java version "1.8.0_172"
Java(TM) SE Runtime Environment (build 1.8.0_172-b11)
Java HotSpot(TM) Client VM (build 25.172-b11, mixed mode)
also tried with:
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) Client VM (build 25.73-b02, mixed mode)
- When using flag "-Djna.boot.library.path=" and pointing to specific JNA it works.
Output on success:
$ java -Djna.debug_load=true -jar hello-jar-with-dependencies.jar
Looking in classpath from sun.misc.Launcher$AppClassLoader@1f96302 for /com/sun/jna/linux-arm/libjnidispatch.so
Found library resource at jar:file:/some/path/hello-jar-with-dependencies.jar!/com/sun/jna/linux-arm/libjnidispatch.so
Output on failure:
Looking in classpath from sun.misc.Launcher$AppClassLoader@1909752 for /com/sun/jna/linux-armel/libjnidispatch.so
Found library resource at jar:file:/some/path/hello-jar-with-dependencies.jar!/com/sun/jna/linux-armel/libjnidispatch.so
Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/jna--873636902/jna2423240844359937896.tmp: /tmp/jna--873636902/jna2423240844359937896.tmp: cannot open shared object file: No such file or directory
My conclusion:
Wrong architecture (armel) is choosen when using JNA 4.5.1.
I am very green on Java and JNA, please be patient if nomenclature is wrong.
also tried with:
Output on success:
Output on failure:
My conclusion:
Wrong architecture (armel) is choosen when using JNA 4.5.1.