0
我正在嘗試使用SIGAR API,並將外部jar「sigar.jar」添加到我的Build Path eclipse項目中。 編譯沒有問題,但是當我嘗試運行主類時,只會這樣做:帶有SIGAR API的ClassNotFoundException
Cpu cpu = new Cpu();
它給了我這個錯誤:
[java] Exception in thread "main" java.lang.NoClassDefFoundError: org/hyperic/sigar/Cpu
[java] at pt.client.User.main(User.java:90)
[java] Caused by: java.lang.ClassNotFoundException: org.hyperic.sigar.Cpu
[java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[java] ... 1 more
[java] Java Result: 1
什麼可能會丟失?