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 |