Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I make lazy/delay loading work in Linux?
    text
    copied!<p>I got this working great on Windows -- application loads my plugin (C++, Qt), my plugin does a smart search to find an installed JRE, sets the library search path accordingly, and then calls a function in the JVM which forces the jvm.dll to be loaded at that point. (Previous question: <a href="https://stackoverflow.com/questions/9120694/how-can-i-deploy-a-mixed-c-java-jni-application">How can I deploy a mixed C++/Java (JNI) application?</a>)</p> <p>Now I'm trying to get it working on Linux. From what I read, lazy linking/loading was the default, so I thought it would just work.... doesn't seem like it.</p> <p>I'd like to avoid <code>dlopen()</code> and <code>dlsym()</code>, <code>LD_LIBRARY_PATH</code>, <code>ldconfig</code>, etc. The idea is that users of this plugin shouldn't have to know how any of that works, they just put the plugin.so in the right place, and when it's loaded, the plugin has the smarts to find the JRE (or tell the user to install a JRE).</p> <p>Can this be done?</p> <p><strong>EDIT</strong></p> <p>Just to be clear... the error I get when the plugin is loaded: "Cannot load library /home/dan/blah/blah/libMyPlugin.so: (libjawt.so: cannot open shared object file: No such file or directory)"</p> <p><strong>EDIT</strong></p> <p>If it matters... this needs to work on Ubuntu 10.10 and up, on CentOS 5.4, and OSX 10.6+.</p> <p>On Ubuntu 10.10, I did <code>apt-get install openjdk-6-jdk</code> and then to get things to run correctly I had to</p> <pre><code>export LD_LIBRARY_PATH= /usr/lib/jvm/java-6-openjdk/jre/lib/i386: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/client: /usr/lib/jvm/java-6-openjdk/jre/lib/i386/xawt </code></pre> <p>(newlines for legibility)</p> <p>But if someone had a different JDK installed (e.g., Sun's) then the directories would probably differ (?).</p>
 

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