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 -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -