I'm writing a script to compile a .java file from within python But the error
import subprocess
def compile_java(java_file):
cmd = 'javac ' + java_file
proc = subprocess.Popen(cmd, shell=True)
compile_java("Test.java")
Error:
javac is not recognized as an internal or external command windows 7
I know how to fix the problem for CMD on windows. But how do I solve it for python? What I mean is: how do i set the path?
PATH, why not simply provide the absolute path ofjavac(orjavac.exein your case)?