How to determine whether java is installed on a system through python?

java, python

Solution

You could use the console commands

>>>import os
>>>os.system("java -version")

java version "1.5.0_19"

or see vartec's answer at Running shell command and capturing the output about storing the output

Problem

Using Python, I want to know whether Java is installed.

Original source

Related problems