aspose file tools*
The moose likes Java in General and the fly likes How can i get all the existing processes in a system? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How can i get all the existing processes in a system? " Watch "How can i get all the existing processes in a system? " New topic
Author

How can i get all the existing processes in a system?

Laura Antanas
Greenhorn

Joined: Jun 01, 2006
Posts: 3
of course using java language.....

Thanks a lot,
Laura
Scott Dunbar
Ranch Hand

Joined: Sep 23, 2004
Posts: 245
You would have to "go native" to do this. Java itself does not include a way to do this because doing it in Windows vs. Unix is bad enough. Now toss in AS/400's and VMS based systems and the methods and permission issues are very different.
[ June 06, 2006: Message edited by: Scott Dunbar ]

<a href="http://forums.hotjoe.com/forums/list.page" target="_blank" rel="nofollow">Java forums using Java software</a> - Come and help get them started.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Only in some platform-specific way. You can execute an external program like UNIX's "ps", or you can use a platform-specific native API using the Java Native Interface. But there's no portable, Java-only way to do this.


[Jess in Action][AskingGoodQuestions]
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961
Calling Runtime.exec("ps") returns a java.lang.Process object. You can ask this object to give you a java.io.InputStream and obtains the ps output.

I have not tested this, because I am currently working on Windows, I will see about it when I get home. But I think this might work:



Best regards,
Edwin Dalorzo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can i get all the existing processes in a system?