How can I check from inside a java program if python is installed in windows? Python does not add its path to the system Path and no assumption is to be made about the probable path of installation(i.e it can be installed anywhere).
Have you tried querying the registry to check if it is installed? It is stored in
software\python\pythoncore
If the user has a (relatively) new version of python, that is installed with the MSI-package, you can use the MsiEnumProducts Function to check if python is installed.
Most Python installers add keys to the Windows registry. Here's an article about how to add that information, you can use it to see how to read the information.
exec(String command) Executes the specified string command in a separate process. Check for Python from command
Use the Java Runtime to exec the following command "python --version".
If it works, you have Python, and the standard output is the version number.
If it doesn't work, you don't have Python.
to everyone else: Python can be installed without modifying the paths, and then you have to run it with a fully qualified path name.