How to get all the running processes in Windows Xp using Java?

J

Jason

I want to get all the running processes in Java. Is there a library
that can do this, or what can I do for this?
Any advice or suggestion will be appreciated.
 
K

kww731029

Jason said:
I want to get all the running processes in Java. Is there a library
that can do this, or what can I do for this?
Any advice or suggestion will be appreciated.

You can write a .dll using C or other language firstly, then you call
it in Java by JNI.
 
D

ddimitrov

You don't mention your operating system (keep in mind that the mere
notion of "process" is OS dependent - e.g. in some embedded
environments all you've got is coroutines).

As a quick and easy way, I'd try running a command-line utility first -
it's easier than doing JNI and gets the job done. You can use ps on
linux and use the one that comes with cygwin on windows. Also, the guys
at http://jniwrapper.com provide a nice windows integration library
that exposes much more than processes.
 
D

Daniel Pitts

ddimitrov said:
You don't mention your operating system (keep in mind that the mere
notion of "process" is OS dependent - e.g. in some embedded
environments all you've got is coroutines).
Actually, he did mention the OS in the subject. Windows XP.
Although, I don't know the answer to his question.
 
J

Jean-Francois Briere

Under Windows XP you could use Runtime.exec() with the tasklist command
then parse the result to get the information needed.
 
J

Jason

Under Windows XP you could use Runtime.exec() with the tasklist command
then parse the result to get the information needed.

This will be a good idea, thank you very much!

Jason
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top