Possible causes of java.io.IOException: CreateProcess error=5 Possible causes of java.io.IOException: CreateProcess error=5 windows windows

Possible causes of java.io.IOException: CreateProcess error=5


error=5 means one of:

1) file is not executable
2) file is not accessible

EDIT: wont throw exception
3) the command (example.exe) exits with exit code 5


Alexandr is correct, it's Windows security that's not allowing that process to run, but that powershell command didn't work for me. here's what I did:

  • Open up Windows explorer, and navigate to example.exe
  • Right click on it and choose "Properties"
  • Go to the "Security" tab and click the "Edit" button
  • Select your username in the top box and in the bottom one give "Full Control" or at least "Read & Execute"
  • Click OK to get rid of these boxes

Now your user can execute that program. Yay!


Sometimes this happens because the path you put in code is not correct. For windows put "\\" as a path separator instead of "\" For example change path to "C:\\example\\example.exe"