| Author |
How to check application running on windows machine using java
|
Indrayani Bhoir
Greenhorn
Joined: Dec 02, 2002
Posts: 21
|
|
Hi friends, i want to check which application are running on windows machine using java. is it possbile check windows properties using java? kindly reply Regards, Indu
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24081
|
|
|
You'd need to use an external (non-Java) program, or use JNI (Java Native Methods.) Java has no "what processes are running on this machine" API, nor any class that represents an externally-started process.
|
[Jess in Action][AskingGoodQuestions]
|
 |
rajeev tiwari
Greenhorn
Joined: Sep 18, 2003
Posts: 9
|
|
I agree with Ernest. But I have little Idea and not sure if it work. How about starting a process through Runtime class and run 'cmd' command for windows. If we pass an OS command as an orgument to cmd command, will it not run the other command. I feel, is should. In that case we can capture the output and know the details of other process running by passing such command name as argument to Cmd command. regards Rajeev javascript: x() banghead
|
Rajeev Tiwari<br />(J2EE Professional)
|
 |
jiju ka
Ranch Hand
Joined: Oct 12, 2004
Posts: 303
|
|
i want to check which application are running on windows machine using java.
I am with Earnest on this. Even if you write a native program to identify the java applications among other applications running on the OS, how can you identify the java applications between themselves. Suppose you write a native program called Applister which gets into the internals of OS and identifies the application. Your java apps may be started like this "java app1", java app2, java app3 where app1 is your class name. In this case AppLister knows three JVMs are running. But AppLister cannot know the class name (which is the application name) unless AppLister can probe into each JVM. I am sure performance diagnosis folks normally use some similar tools like jprobe. If you post this in performance forum you will get some lead.
|
 |
Michael Ernest
High Plains Drifter
Sheriff
Joined: Oct 25, 2000
Posts: 7292
|
|
Originally posted by rajeev tiwari: If we pass an OS command as an argument to cmd command, will it not run the other command. I feel, is should. In that case we can capture the output and know the details of other process running by passing such command name as argument to Cmd command.
This is rather like monitoring a room through a keyhole because you think opening the door is too obvious. You can do it, but it's hard to see why you would want. If you're fond of three-legged races or passing eggs to others using only a spoon, I can imagine the appeal of this exercise. I just can't see the practical value.
|
Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
|
 |
 |
|
|
subject: How to check application running on windows machine using java
|
|
|