I’m currently writing a program in Python, and I would like to determine the path to the JDK install directory if it’s on the system. Is there a way of doing this in Python? If not, is there a way of doing it in Java (or another language)? If it is the latter, I could open a subprocess from within Python to obtain it.
Thanks.
You can check for JAVA_HOME or JDK_HOME system variables. But there is no guarantee that there are no other JDKs installed. You have to be more specific what you are willing to achieve.