After implementing a quick prototype to support additional JNI library suffixes,
I rediscovered the Apple contribution and solution for this support. The two
solutions are remarkably similar. Thus, the Apple solution appears to be the correct
I've started with the Apple solution and made a few improvements to make it more
generic and performant. The two testcases I've been working with now pass with
the libraries named *.jnilib or *.dylib. More rigorous testing required to
ensure there are no regressions on other platforms.
Quick note, the code changes are in System.java and ClassLoader.java on the JDK side.
The aforementioned hotspot code is used to load native libraries used by hotspot,
such as libverify, libzip, and libjava. So, the real solution for JNI libraries
is in the JDK.