Python will not execute Java program: 'java' is not recognized
You have to set the PATH variable to point to the java location.
import os
os.environ["PATH"] += os.pathsep + os.pathsep.join([java_env])
java_env will be a string containing the directory to java.
(tested on python 3.7)
I am trying to get Python to call a Java program using a command that works when I enter it into the command line.
When I have Python try it with subprocess or os.system, it says:

'java' is not recognized as an internal or external command, operable
  program or batch file.

From searching, I believe it is because when executing through Python, it will not be able to find java.exe like a normal command would.