Author adamburke
Recipients adamburke, fwierzbicki, mniklas, santa4nt, zyasoft
Date 2018-10-18.04:56:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I have hit a similar issue and have a possible cause and workaround. 

I am not clear on why yet, but it seems the normal behaviour when calling out to a Windows executable from Java is for a very limited environment to be available. The command line has to be explicitly invoked to get the context of standard commands and batch files.


Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Adam\jython\jython\dist\Lib\", line 535, in call
    return Popen(*popenargs, **kwargs).wait()
  File "C:\Users\Adam\jython\jython\dist\Lib\", line 892, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\Adam\jython\jython\dist\Lib\", line 1402, in _execute_child
    raise OSError(errno.ENOENT, os.strerror(errno.ENOENT))
OSError: [Errno 2] No such file or directory
 Volume in drive C is OS
 Volume Serial Number is E447-FAFD

 Directory of C:\Users\Adam\jython\jython


Coming from a more Unix-y background I find this quite unintuitive, but there you go.

Related stackoverflow answer here:

I have been able to invoke batch files successfully on the latest Jython using cmd /c and subprocess.

I am not sure what the correct target behaviour for jython should be here. I guess CPython can be a guide to whether cmd /c should be invoked by default when calling out to subprocess under windows. That is the extent of my research for now.
Date User Action Args
2018-10-18 04:56:02adamburkesetmessageid: <>
2018-10-18 04:56:02adamburkesetrecipients: + adamburke, fwierzbicki, zyasoft, mniklas, santa4nt
2018-10-18 04:56:02adamburkelinkissue2023 messages
2018-10-18 04:56:01adamburkecreate