Check if a Virtual Machine (VM) is running

Please let me know if there's a way I can check a given Virtual Machine (VM) is running.
The VM is not necessarily the Java VM.

Thanks!
dshrenikAsked:
Who is Participating?
 
CEHJConnect With a Mentor Commented:
Use tasklist or some such utility from within Java (on Windows)
0
 
dshrenikAuthor Commented:
How can I do it in an OS-independent way? Thanks!
0
 
for_yanCommented:
Waht means VM is not necessraily Java VM ?

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
for_yanCommented:
What other VM do you have in mind?
0
 
dshrenikAuthor Commented:
Its being developed in my company. Not released yet.
0
 
for_yanConnect With a Mentor Commented:

You probably cannot do it in OS independent way, but you cvan detemrin
System.getProperty("os.name") and based on that
cover most important OS, like here:

http://stackoverflow.com/questions/54686/how-to-get-a-list-of-current-open-windows-process-with-java


http://stackoverflow.com/questions/6665782/list-of-running-programs-in-linux-using-java
0
 
for_yanCommented:
Your company may name it as they want and from point of view of OS VM is nothing more but one more application so there is no way
you can know thatbtis task is VM and thsi is not and you even have to come up with definition what is VM
Processing of any text can also be considered VM - so this is not very clearly defined
0
 
dshrenikAuthor Commented:
Let me simplify the question:
Can I get to know the names of the Java packages that are active.
Like in Java VisualVM, you can check the packages that are active..
0
 
for_yanCommented:
Sorry what is Java VisualVM and waht you mean by packages?
0
 
dshrenikAuthor Commented:
C:\Program Files (x86)\Java\jdk1.6.0_20\bin\jvisualvm.exe
It is used for profiling.

What I meant was when I have a Java application running (could be third party), how do I know the names of the packages of the classes that are running?
0
 
for_yanCommented:
That is absolutely different question that your company writing soem new virtual machine

But I don't think you can do it from outside of your java code
You can look at the classpath of your application but what packages are running at particular moment?
It is hardly possible to track from outside, I think
0
 
for_yanCommented:
You may use
jstack -l pid
0
 
for_yanCommented:
where pid is the pid number in task manger of your process -jastack in your Java/bin folder will have some printout of
threads  currently running and there are some class names there
0
 
CEHJCommented:
:)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.