If you want to start
I found no easy way to predict which concrete port will be opened by using an anonymous port.
But I found a rewrite of
jstatd called "jakestatd" which will force the 3 ports (because at last, I discovered that
jstatd actually opens 3 ports and not 2 as I first thought) that
As it was not enough for me because I needed to control those ports, I wrote ejstatd that answer this exact question (as well as others), so now I can control thos ports using (inside ejstatd's folder):
mvn exec:java -Dexec.args="-pr 2222 -ph 2223 -pv 2224"
Here the 3 ports that will be opened will be
2224, and the RMI registry will be available at port