Nach der Aktualisierung von Java von 1,6 auf 1,7 x64 (unter Windows 7) kann ich java.exe plötzlich nicht mehr über das Modul subprocess
von Python 2.7 starten. Das folgende Skript nur verwendet arbeiten:Warum kann Python java.exe nicht über Subprozess ausführen?
import subprocess
subprocess.check_call([r"C:\Windows\system32\java.exe"])
Jetzt schlägt es wie folgt aus:
Traceback (most recent call last):
File ".\tst.py", line 2, in <module>
subprocess.check_call([r"C:\Windows\system32\java.exe"])
File "C:\Python27\lib\subprocess.py", line 506, in check_call
retcode = call(*popenargs, **kwargs)
File "C:\Python27\lib\subprocess.py", line 493, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 896, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
ich auch bestätigt haben, dass C:\Windows\system32\java.exe
tatsächlich existiert, ist eine Anwendung, und kann von der Kommando-Shell ausgeführt werden .
Was läuft hier falsch?
EDIT: ich gefunden habe, dass ich C:\Program Files\Java\jre7\bin\java.exe
von Python starten können, so C:\Windows\system32\java.exe
müssen einige seltsame pseudo-Verknüpfung obwohl technisch eine Windows-Anwendung sein. Version 1.7 muss es irgendwie vermasselt haben, da ich gerade bestätigt habe, dass Version 1.6 in Ordnung ist.
Sind Sie sicher, dass es kein Link ist? – Marcin
@Marcin Der Dateityp ist nach den Dateieigenschaften 'Application (.exe)'. – aknuds1
Das ist ... komisch. – Marcin