From: rose j. <rsn...@gm...> - 2010-03-02 06:38:25
|
HI all, I'm doing the memory usage and file system disk usage monitoring on Windows and Linux (Ubuntu). The program works in Windows(I put the sigar library in the jdk library) and now i'm having problem with the ubuntu. Where should i pun the sigar library in ubuntu? |
From: rose j. <rsn...@gm...> - 2010-03-03 01:32:39
|
okay, if we didn't put the sigar.so file in the same folder with jdk library, then how to run my program? please someone help, need help as soon as possible. Thanks |
From: Faur Ioan-A. <fi...@gm...> - 2010-03-11 18:12:44
|
Hi! Folks we have some problem's down here with SIGAR api.We are kind of novice so please give some help! I'm using ubuntu i have java installed and i want to make a little app that show me the cpu load and free memory available.So i downloaded the sigar api from this link [link]http://sourceforge.net/projects/sigar/files/sigar/1.6/hyperic-sigar-1.6.3.zip/download[/link] I extracted from the zip but i'm confuse :what to do from now on?(what to do with those jar files from lib director?).How can i compile an app that use this api.For example how to compile CpuInfo.java from ../hyperic-sigar-1.6.3/bindings/java/examples/ Please help us! |
From: Faur Ioan-A. <fi...@gm...> - 2010-03-11 18:12:41
|
Here i came back!After a sleep less night i finally get something to work! After a lot of research's i finally put some working code.Here's the trick for all of us ,the beginer's in java world! Let's say that you want to compile and run some of the standard examples that come with sigar api.So you have this directory where is put the examples:[code]../hyperic-sigar-1.6.3/bindings/java/examples[/code] Now you open a terminal and do a cd to the structure above.Now you should copy the [code]sigar.jar[/code] from the [code]../hyperic-sigar-1.6.3/sigar-bin/lib[/code] in to the examples directory. Now in you'r terminal opene'd to the ../examples type this command to compile a class.I'll take the CpuInfo.java class.So type this:[code]javac -cp "sigar.jar" CpuInfo.java[/code] Acording to man page's the -cp "sigar.jar" mean:"Specify where to find user class files" for more info check up the[code] man javac[/code] Now you need to run the class so type:[code]java -jar sigar.jar CpuInfo[/code].Again for more info do [code]man java[/code] And i think that's all.This i think should work even on the window's machine. Cheer's1 |
From: rose j. <rsn...@gm...> - 2010-03-12 02:28:34
|
hi fioan, in windows, it will be easier if you simply paste the sigar lib into jdk lib. can we do that in ubuntu? |
From: Faur Ioan-A. <fi...@gm...> - 2010-03-12 19:12:29
|
Well in Ubuntu there's a jvm directory in /usr/lib/ but this ./jvm have other'ssubdirectories' but don't know where to copy them.Until then i put the sigar.jar in current class directory! |
From: rose j. <rsn...@gm...> - 2010-03-15 08:34:41
|
have a look at this: rose@rose-desktop:~$ javac -cp sigar.jar MemoryMonitor.java rose@rose-desktop:~$ java MemoryMonitor Exception in thread "main" java.lang.NoClassDefFoundError: org/hyperic/sigar/SigarException Caused by: java.lang.ClassNotFoundException: org.hyperic.sigar.SigarException at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: MemoryMonitor. Program will exit. then, i tried another command: rose@rose-desktop:~$ java -cp sigar.jar MemoryMonitor Exception in thread "main" java.lang.NoClassDefFoundError: MemoryMonitor Caused by: java.lang.ClassNotFoundException: MemoryMonitor at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: MemoryMonitor. Program will exit. both got errors. |
From: rose j. <rsn...@gm...> - 2010-03-12 06:40:13
|
hi fioan, I've tried that command, can only compile but cannot run the program. i got this error: unknown command: MemoryMonitor what should i do?please someone help us. we crucially need help:( |