Email from ###@###.###:
---------------------------------------
Do you happen to know if it's possible to dlopen( libjvm.so )? I'm able to do so and get a reference to JNI_CreateJavaVM. But when I actually invoke JNI_CreateJavaVM I end up getting an error:
-----
Error occurred during initialization of VM
Unable to load native library: libjvm.so: cannot open shared object file: No such file or directory
-----
This doesn't make sense to me since I already loaded the library. I straced it and I think it's libjava.so trying to open libjvm.so and for some reason it cannot find it.
Does this sound at all familiar to you? Do you have any tips? If not, is there anyone on your team that might be able to help?
I'm trying to make it so my app can launch without having the JVM directories in LD_LIBRARY_PATH.
---------------------------------------
Bug 4976297 explained the root cause for this failure: library libjava.so
has a dependency on libjvm.so, when libjava.so is loaded, the dynamic
linker first searches existing libraries based on their sonames. Because
currently we don't set soname when building libjvm.so, dynamic linker will
think libjvm.so is not loaded even though it's already dlopen'ed by the
user application, causing a runtime error if libjvm.so is not on
LD_LIBRARY_PATH.
This behavior forces users of JVM invocation API to set LD_LIBRARY_PATH,
which can be quite complex (see Java launcher code for proof). When
LD_LIBRARY_PATH is not properly set up, applications that us invocation
API will behave differently on Solaris and Linux.
---------------------------------------
Do you happen to know if it's possible to dlopen( libjvm.so )? I'm able to do so and get a reference to JNI_CreateJavaVM. But when I actually invoke JNI_CreateJavaVM I end up getting an error:
-----
Error occurred during initialization of VM
Unable to load native library: libjvm.so: cannot open shared object file: No such file or directory
-----
This doesn't make sense to me since I already loaded the library. I straced it and I think it's libjava.so trying to open libjvm.so and for some reason it cannot find it.
Does this sound at all familiar to you? Do you have any tips? If not, is there anyone on your team that might be able to help?
I'm trying to make it so my app can launch without having the JVM directories in LD_LIBRARY_PATH.
---------------------------------------
Bug 4976297 explained the root cause for this failure: library libjava.so
has a dependency on libjvm.so, when libjava.so is loaded, the dynamic
linker first searches existing libraries based on their sonames. Because
currently we don't set soname when building libjvm.so, dynamic linker will
think libjvm.so is not loaded even though it's already dlopen'ed by the
user application, causing a runtime error if libjvm.so is not on
LD_LIBRARY_PATH.
This behavior forces users of JVM invocation API to set LD_LIBRARY_PATH,
which can be quite complex (see Java launcher code for proof). When
LD_LIBRARY_PATH is not properly set up, applications that us invocation
API will behave differently on Solaris and Linux.
- duplicates
-
JDK-5027311 Attempt to setuid java process results in a hang
-
- Closed
-
- relates to
-
JDK-4976297 JAWT apps on Linux now have to set LD_LIBRARY_PATH to point to libmawt.so
-
- Resolved
-