RFR: JDK-8319516 - Native library suffix impact on the library loading in AIX- Java Class Loader [v8]

Martin Doerr mdoerr at openjdk.org
Mon Apr 1 18:40:01 UTC 2024


On Mon, 1 Apr 2024 18:31:52 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> > Now, I'm getting "java.lang.UnsatisfiedLinkError: no libname.a in java.library.path" when trying `System.loadLibrary("libname.a")` even though the file exists in the library path. Is this intended?
> 
> To load a library file, you should use `System.load(<lib-absolute-path>)` instead.
> 
> For `System::loadLibrary` API, it loads the native library specified by the `libname` argument. The `libname` argument must not contain any platform specific prefix, file extension or path. See the javadoc [1].
> 
> [1] https://download.java.net/java/early_access/jdk23/docs/api/java.base/java/lang/System.html#loadLibrary(java.lang.String)

Ok, you convinced me that getting an exception is the correct behavior. Nevertheless, the exception message is wrong. It claims that the file didn't exist, but it does. The problem is a different one.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17945#issuecomment-2030328475


More information about the core-libs-dev mailing list