Provide complete information about the problem
- Version of JNA and related jars
jna and jna-platform are 5.2.0
- Version and vendor of the java virtual machine
OpenJDK 1.8.0_202 with HotspotVM
- Operating system
AIX 7.1 64-bit
- System architecture (CPU type, bitness of the JVM)
PowerPC 64
- Complete description of the problem
When I try to use JNA on AIX 64-bit (though it will probably work as well the same way in 32-bit, judging by the library format), I get this exception (my code paths truncated at the end):
Exception in thread "main" java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/aix-ppc64/libjnidispatch.so) not found in resource path ([file:/opt/sysshepjr/agent/sysshepjr.jar])
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:1026)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:988)
at com.sun.jna.Native.<clinit>(Native.java:195)
at com.sun.jna.platform.unix.LibC.<clinit>(LibC.java:35)
Looking at the library stated, it is in there in .a format. Like many Linux/Unix systems, AIX allows linking against .so shared objects and .a static libraries, but it also allows .a archives to store .so shared objects to allow "smart switching" based on bitness (allowing one archive to have both the 32-bit and 64-bit libraries). The library that is in the release is named .a, but it is not an ar archive, it is a shared object renamed to .a (including the 32-bit version). There are two obvious options for fixing this:
- Rename the .a back to .so for both 32-bit and 64-bit, allowing the loader to correctly find it. This is preferable, because JNA already distinguishes based on path the bit size.
- Rename the .a back to .so for both, and pack them in a .a archive, and correctly refer to the archive by the AIX contained member style. This makes the library more in the style of typical AIX libraries, but doesn't really bring any advantages to the table.
Provide complete information about the problem
jna and jna-platform are 5.2.0
OpenJDK 1.8.0_202 with HotspotVM
AIX 7.1 64-bit
PowerPC 64
When I try to use JNA on AIX 64-bit (though it will probably work as well the same way in 32-bit, judging by the library format), I get this exception (my code paths truncated at the end):
Looking at the library stated, it is in there in .a format. Like many Linux/Unix systems, AIX allows linking against .so shared objects and .a static libraries, but it also allows .a archives to store .so shared objects to allow "smart switching" based on bitness (allowing one archive to have both the 32-bit and 64-bit libraries). The library that is in the release is named .a, but it is not an ar archive, it is a shared object renamed to .a (including the 32-bit version). There are two obvious options for fixing this: