I have 16 Java processes with the same main method and arguments running on the same machine. I want to track them remotely through JConsole.
Hard-coding port numbers, such as -Dcom.sun.management.jmxremote.port=5000 , will not work because these processes use the same configuration and they cannot work with the same port.
Is it possible for the JVM to dynamically select a different port for each of the 16 processes?
source share