• 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
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

How to check application running on windows machine using java

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic