mhlkmn0108 / junixsocket

Automatically exported from code.google.com/p/junixsocket
1 stars 0 forks source link

Allow specifying the native lib location via LD_LIBRARY_PATH #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi.

Please add additional way to specify for JVM where to locate the native 
library, by setting the LD_LIBRARY_PATH parameter.

Thanks!

Original issue reported on code.google.com by neoitisr...@gmail.com on 31 Oct 2010 at 8:31

GoogleCodeExporter commented 9 years ago
Hello there.

I've patched the code of version 1.3 to let the user set the path via 
LD_LIBRARY_PATH or SHLIB_PATH. With this change, the java code will try to 
locate the native library on the following paths in this specific order:

1. Path given by java property "org.newsclub.net.unix.library.path"
2. All paths found in environment variable LD_LIBRARY_PATH
3. All paths found in environment variable SHLIB_PATH
4. All paths listed in NativeUnixSocketConfig.DEFAULT_LIBRARY_DIRS, which is a 
String[]
5. System library path via System.loadLibrary()

Cheers,
Enrique.

PD: Sorry for the indentation. When I noticed I had modified it I had the 
changes already in place. Let me know if this is not convenient and I'll create 
a .patch file when I have some spare time.

Original comment by enrique....@gmail.com on 5 May 2011 at 10:10

Attachments: