Is there a way to find which jvms are currently running, and get their PIDs? e.g. when launching JVisualvm, it shows all local jvms. How can I do that?
Background: I'm working on an instrumentation project, and I would like to attach an agent to another (unknown) java process. The idea is to display all currently running java processes, and let the user choose a process from that list. Thanks!
[edit] I do mean processes, not threads.