Using Python, I want to know whether Java is installed.
Using Python, I want to know whether Java is installed.
There is no 100% reliable / portable way to do this, but the following procedure should give you some confidence that Java has been installed and configured properly (on a Linux):
This doesn't guarantee that the user has not done something weird.
Actually, if it was me, I wouldn't bother with this. I'd just try to launch the Java app from Python assuming that the "java" on the user's path was the right one. If there were errors, I'd report them.