Hyperic Sigar Mac Osx Error - No Library

Hi, using the name of the third Hyperic Sigar lib group. When I run my code, it shows an error,

This is my code:

package pack;

import org.hyperic.sigar.*;

public class NetworkData {
    public static void main(String[] args) {
   Sigar sigar = new Sigar();
    }

}

This error message is:

1 [main] DEBUG Sigar  - no libsigar-universal64-macosx.dylib in java.library.path
org.hyperic.sigar.SigarException: no libsigar-universal64-macosx.dylib in java.library.path
    at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:172)
    at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:100)
    at pack.NetworkData.main(NetworkData.java:10)

Im developing on Mac OSX Snow Leopard using the Eclipse IDE for Java developers ( no sigar-x86-winnt.dll in java.library.path error when using Hyperic SIGAR on a multilingual OS ) The message says I need to add some way if so ... How to add this path to Mac Osx? Hope someone can help ^^

+5
source share
3 answers

Sigar.jar , .dylib ( , ). libsigar-universal64-macosx.dylib, "hyperic-sigar-1.6.4/sigar-bin/lib".

+3

, jar ( ) . , , ​​ mysql driver java. , log4j.jar sigar.jar .

eclipse, > > Java > JAR sigar.jar .

+2
 # to find it later because you will need it ...
 cd ~/Downloads/

 # or whatever the latest one at the time of reading is ... 
 curl https://netix.dl.sourceforge.net/project/sigar/sigar/1.6/hyperic-sigar-1.6.4.zip

 # unpack the package to the tmp dir
 sudo unzip -o /Users/phz/Downloads/hyperic-sigar-1.6.4.zip -d /tmp/

 # copy the libsigar-universal64-macosx.dylib to your class path dir
 sudo find /tmp/ -name libsigar-universal64-macosx.dylib \
   -exec cp -v {} /Library/Java/Extensions/ \;

 # this cmd might be obsolete ... 
 # copy the sigar.jar to your class path dir
 sudo find /tmp/ -name sigar*.jar \
   -exec cp -v {} /Library/Java/Extensions/ \;

 # set you classpath dir, or add in ~/.bash_profile
 # or even better https://github.com/YordanGeorgiev/ysg-confs
 export CLASSPATH=$CLASSPATH:/Library/Java/Extensions

 # you should not see the error anymore 
 cd $my_proj_dir ; sbt compile

 # neither here .. 
 cd $my_project_dir ; clear ; sbt "test:testOnly *testClass"
+2

All Articles