How to override native JRE libraries?

Is it possible to override the native JRE library with the library in my own location? I tried using -Djava.library.path=... , but when I check lsof -p , the process still uses a copy of the JRE.

Reference Information. On Oracle JRE 7 on Mac OS X, the javax.security.smartcardio library is broken. If you call list () too often, this happens. But since the correction was simple (incorrect signature of a 64-bit function), I was able to create OpenJDK and create a fixed library libj2pcsc.dylib , which I want to use, if possible, without replacing the system library.

+4
source share
2 answers

I don't know if this will work for you, but one idea that comes to mind is the java extension mechanism. I have never tried this myself, but perhaps it can achieve what you want.

0
source

If you can link your fix to a shared object, you can try to force it to be loaded in front of the system library by setting LD_LIBRARY_PRELOAD:

 $ LD_LIBRARY_PRELOAD=/path/to/your/libj2pcsc.dylib java com.yourpkg.YourClass 
0
source

All Articles