我需要一个可以告诉我服务器当前负载的Java库,所以在搜索之后我发现SIGAR目前是最知名的并且在社区中被广泛接受。
我正在使用Linux Mint 64位作为操作系统(它是对Ubuntu的略微修改),因为这是我第一次使用这样的库,我使用Eclipse从零创建了一个新项目并决定在其上安装SIGAR通过做:
但是,当我运行项目时,我收到以下错误:
/media/data/Users/pedro/SIGAR/libs/libsigar-amd64-linux.so: /media/data/Users/pedro/SIGAR/libs/libsigar-amd64-linux.so: failed to map segment from shared object: Operation not permitted
org.hyperic.sigar.SigarException: /media/data/Users/pedro/SIGAR/libs/libsigar-amd64-linux.so: /media/data/Users/pedro/SIGAR/libs/libsigar-amd64-linux.so: failed to map segment from shared object: Operation not permitted
at org.hyperic.sigar.Sigar.loadLibrary(Sigar.java:172)
at org.hyperic.sigar.Sigar.<clinit>(Sigar.java:100)
at examples.Shell.<init>(Shell.java:50)
at examples.SigarCommandBase.<init>(SigarCommandBase.java:75)
at examples.CpuInfo.<init>(CpuInfo.java:36)
at examples.CpuInfo.main(CpuInfo.java:97)
Exception in thread "main" java.lang.UnsatisfiedLinkError: org.hyperic.sigar.Sigar.getCpuInfoList()[Lorg/hyperic/sigar/CpuInfo;
at org.hyperic.sigar.Sigar.getCpuInfoList(Native Method)
at examples.CpuInfo.output(CpuInfo.java:60)
at examples.SigarCommandBase.processCommand(SigarCommandBase.java:186)
at examples.CpuInfo.main(CpuInfo.java:97)
我检查了互联网,当我没有写入或读取权限时,通常会发生Operation not permitted
错误,但事实并非如此。
因此我有一些问题:
感谢您的时间,佩德罗。