Note that there are some explanatory texts on larger screens.

plurals
  1. POPurpose of com.ibm.oti.vm.bootstrap.library.path on AIX j9vm JVM
    primarykey
    data
    text
    <h1>Background</h1> <p>I have a C++ program that loads a JVM internally and then uses JNI to call code in the JVM. This runs on multiple platforms including AIX. However, when starting the JVM on AIX everything is fine until I call some code that needs to access native code supplied as part of the JRE. I then run into this error message:</p> <pre><code>java.lang.UnsatisfiedLinkError: net (Not found in com.ibm.oti.vm.bootstrap.library.path) </code></pre> <p>The problem is that the JVM cannot find the shared library <code>libnet.so</code>. If I dump the value of the <code>com.ibm.oti.vm.bootstrap.library.path</code> system property from Java code running in the JVM I see that by default (i.e. not me setting it) it has the value:</p> <pre><code>&lt;jre-base-dir&gt;/lib/ppc/default:&lt;jre-base-dir&gt;/lib/ppc </code></pre> <p>From the error message I guessed it would be a good idea to change this to include the dir where <code>libnet.so</code> is located. However, this shared library is in <code>&lt;jre-base-dir&gt;/lib/ppc</code> which is already in the path set by <code>com.ibm.oti.vm.bootstrap.library.path</code>, so it seems the error message is incorrect.</p> <p>Experimenting with different values for this system property makes me believe that it is used by the AIX j9vm to load the internal JVM shared libraries only (like <code>libjclse7b_26.so</code>) but not the native code implementations (like <code>libnet.so</code>).</p> <h1>My fix</h1> <p>To fix my problem I had to change the <code>LIBPATH</code> environment variable (which is AIX the equivalent of <code>LD_LIBRARY_PATH</code> in e.g. Linux).</p> <pre><code>$ LIBPATH=&lt;jre-base-dir&gt;/lib/ppc:&lt;jre-base-dir&gt;/lib/ppc/j9vm ./myprogram </code></pre> <h1>Questions</h1> <ol> <li><p>Can anyone shed some light on the real purpose of the system property <code>com.ibm.oti.vm.bootstrap.library.path</code> on AIX when using the j9vm JVM?</p></li> <li><p>Is my fix the correct way to solve the problem or should I use some other system property? (I have tried <code>java.library.path</code> but it does not seem to help.)</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload