title: Load shared library by path at runtime
body: <p>I am building a Java application that uses a shared library written in C++ and compiled for different operating systems. The problem is, that this shared library itself depends on an additional library it normally finds under the appropriate environment variable (<code>PATH</code>, <code>LIBRARY_PATH</code> or <code>LD_LIBRARY_PATH</code>).</p>
  
  <p>I can - but don't want to - set these environment variables. I'd rather load the needed shared libraries from a given path at runtime - just like a plugin. And no - I don't want any starter application that starts a new process with a new environment. Does anybody know how to achieve this?</p>
  
  <p>I know that this must be possible, as one of the libraries I use is capable of loading its plugins from a given path. Of course I'd prefer platform independent code, but if this ain't possible, seperate solutions for Windows, Linux and MacOS would also do it.</p>
  
  <p><strong>EDIT</strong>
  I should have mentioned that the shared library I'd wish to use is object oriented, which  means that a binding of single functions won't do it.</p>