Discussion:
Netbeans not setting java.library.path
bocockli
2011-12-31 03:13:07 UTC
Permalink
Hi

MACOS 10.6.8
Netbeans 7.0.1

I'm trying to use JNI (Oracle Sleepycat DB) which uses native libraries.

Works on the command line using java -Djava.library.path=/native-lib-path

Works if I symlink the native libraries to /Library/Java/Extensions (horrible solution)

Fails in Netbeans: Have tried:


Added -J-Djava.library.path= to netbeans.conf
Added -Djava.library.path=/native-lib-path to project VM options


System.out.println(System.getProperty("java.library.path")) in the application shows the JVM is not getting passed the additional library path.

Netbeans seems to be completely ignoring any attempt to set the java.library.path

Ideas?

Thanks, Len
bocockli
2012-01-01 07:16:10 UTC
Permalink
:D

Two resolutions to the JNI problem. One for NetBeans, one for Glassfish.

To get JNI to work with Netbeans on MACOS, run a command shell, set the DYLD_LIBRARY_PATH variable to the library path and launch Netbeans off the command line.

Netbeans:
export DYLD_LIBRARY_PATH=/Library/BerkeleyDBXML.2.5.16/lib
/Applications/NetBeans/NetBeans\ 7.0.1.app/Contents/MacOS/netbeans &

Glassfish:
Add the JVM library path option to the server console using the Glassfish administration console.

-Djava.library.path=/Library/BerkeleyDBXML.2.5.16/lib

Continue reading on narkive:
Loading...