List of running programs in Linux using java -



List of running programs in Linux using java -

i'm trying code task manager linux using java.

i need list of running programs. , other info like: memory usage, cpu usage ...

is possible java?

thanks.

try { // execute command string command = "ps aux"; process kid = runtime.getruntime().exec(command); // input stream , read inputstream in = child.getinputstream(); int c; while ((c = in.read()) != -1) { process((char)c); } in.close(); } grab (ioexception e) { }

source (modified): http://www.exampledepot.com/egs/java.lang/readfromcommand.html

java linux process operating-system

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -