Hello JikesRVM researchers,
I’m trying to use Sigar (http://sourceforge.net/projects/sigar/) in VM code. The main class (Sigar.class) uses JNI calls to the libsigar-x86-linux.so native library.
When I use Sigar in a Java “user” program and then run it using the JikesRvm everything is ok.
The problem is when I use Sigar in the VM code. I have a dedicated class that extends Thread (extending RVMThread leads to other interesting problems), and the run method uses Sigar. I create the thread just before the MainThread in the method VM.boot(), but although I have tried many forms of referring the correct library file, the error message is always the same “failed to load sigar-x86-linux: null pointer exception” (this message is produced by the Sigar library).
Looking at the Sigar source code (and the exception trace) one can see that the native library is loaded in the class’s static constructor.
Because I can use the same exact code in “user” code, I was expecting that the VM code would solve the native library the same way.
The Gnu Classpath refers to a system property called java.library.path, but that didn’t work too. When running the “user” program I don’t have to set anything for Jikes to find the native library. Just have to be in the running directory.
Does this problem seems familiar to anyone?
Thanks for any help.