From: jrallen9 <jus...@te...> - 2010-07-10 01:29:43
|
In my project and runtime directory i have a lib directory so this bit of codes works to load the Linux x86 so version. File executionPath = new File(""); System.load(executionPath.getAbsolutePath() + "/lib/sigar-lib/lib/libsigar-x86-linux.so"); Make sure you are loading the right so for your runtime enviornment. This bit of code is dynamic based on the JVM environment: if(System.getProperty("os.name").toLowerCase().contains("linux")){ if(System.getProperty("os.arch").toLowerCase().compareTo("i386") == 0){ System.load(executionPath.getAbsolutePath() + "/lib/sigar-lib/lib/libsigar-x86-linux.so"); } else if(System.getProperty("os.arch").toLowerCase().compareTo("amd64") == 0){ System.load(executionPath.getAbsolutePath() + "/lib/sigar-lib/lib/libsigar-amd64-linux.so"); } Let me know if that works or you have more problems. |