Question: How to get in Java 6+ the list of running JVMs on the localhost and their specs (i.e. Java version, running threads, etc.)?

Does the Java API provide such features? Is there a Java library that can do this?

Answer: 
This, I found out today, is basically what JPS does: simply list the folder **/tmp/hsperfdata\_foo/** where foo is the user running the JVM.

For some unknown reason, sometimes the files there won't be deleted when a JVM is killed.

Here are the links to the source code:

[PerfDataFile.java](http://javasourcecode.org/html/open-source/jdk/jdk-5.0/sun/jvmstat/perfdata/monitor/protocol/local/PerfDataFile.java.html)

[LocalVmManager](http://www.java2s.com/Open-Source/Java-Document/6.0-JDK-Modules-sun/jvmstat/sun/jvmstat/perfdata/monitor/protocol/local/LocalVmManager.java.htm)
As far as I know the jps provides the list of process launched using the jvm it belongs to. If you have multiple JDKs installed I don't think it would be of help.
If you want a list of all java processes you have to use "ps -ef | grep java". I have seen many times JVsualVM couldn't identify all the java processes running on a specific host. If you requirement is specific to a JVM launched processes the above suggestions would apply.