• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
of course using java language.....

Thanks a lot,
Laura
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
author and iconoclast
Posts: 24203
43
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!