On Linux you can run $(dirname $(dirname $(readlink -f $(which javac))))
On Mac you can run $(dirname $(readlink $(which javac)))/java_home
I'm not sure about windows but I imagine where javac
would get you pretty close
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…