• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Listing the running processes on a system in a Platform independent manner

 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was exploring the possibility of listing the running processes on a system in a Platform independent manner in Java,and found that such a thing is not possible using Java libraries.

Of course ,we can execute platform specific scripts using Runtime.exec()to enumerate currently executing processes on a system,but there are no standard APIs to do that seamlessly across all platforms.

Another approach is to plug in system specific programs into a Java Application using JNI.

Any comments on this?
[ August 01, 2008: Message edited by: Ajay Saxena ]
 
Marshal
Posts: 76802
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The title to this thread sounds like a contradiction in terms; you can only list running processes by interaction with the OS, and that is platform-specific.
 
Ajay Saxena
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The title to this thread sounds like a contradiction in terms; you can only list running processes by interaction with the OS, and that is platform-specific.



Well, interaction with OS is indeed platform specific,but then JVM implementation is platform specific too.

Therefore I was wondering if the Java platform provides some standard APIs to enumerate processes on any OS. The API implementation would definitely be platform specific and therefore native.

Hope that makes sense!
 
Campbell Ritchie
Marshal
Posts: 76802
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can't think of anything. There's nothing like that in the java.lang.System class. Because Java is designed for system independence, that is not the sort of thing one would include in an API.

Anybody else know of anything?
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nope. There isn't even a standard API for getting your own process PID, which is really annoying for writing PID files. There are solutions, but they all involve calling outside java land.
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic