Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

-Djava.library.path not work on linux?

843798Sep 14 2006 — edited Sep 20 2006
I am invoking the java vm with -Djava.library.path=_MY_LIBRARY_PATH_ and this does not seem to be reflected by java during execution. I see this behaviour on J2SE 5.0.x and J2SE 6.0 beta2.

I am trying to set LD_LIBRARY_PATH so that my app can load shared objects that are in the Java application's directory. Essentially, I have two shared objects, libA.so and libB.so. libB.so is dependent on libA.so, but libA.so is NOT dependent on libB.so (i.e.: there is no circular dependency). I can:

System.loadLibrary( "A" ); // Works
System.loadLibrary( "B" ); // Throws UnsatisfiedLinkError because B can't find A on the LD_LIBRARY_PATH.

Are there any work-arounds to this problem?

Also, this is a WebStart application, so an sh script to set the LD_LIBRARY_PATH prior to launch doesn't seem feasible.

Any ideas or work-arounds for this bug?

Thanks much.
Dustin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 18 2006
Added on Sep 14 2006
4 comments
462 views