• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to check application running on windows machine using java

 
Indrayani Bhoir
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
rajeev tiwari
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic