This is another approach to analyzing the process list from the ps -e command:
try { String line; Process p = Runtime.getRuntime().exec("ps -e"); BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { System.out.println(line);
If you use Windows, you should change the line: "Process p = Runtime.getRun ...", etc. (3rd line), for the following:
Process p = Runtime.getRuntime().exec (System.getenv("windir") +"\\system32\\"+"tasklist.exe");
We hope the information helps!
ramayac Sep 10 '08 at 18:30 2008-09-10 18:30
source share