-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b51
-
windows
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8084502 | emb-9 | Thomas Stuefe | P4 | Resolved | Fixed | team |
On Windows, when redirecting ProcessBuilder output to a file using ProcessBuilder.Redirect.appendTo(file), only file names up to 250 characters are allowed. Specifying longer filenames causes an IOException.
The IOException is misleadingly stating "Cannot find the file specified", e.g.:
Exception in thread "main" java.io.IOException: Cannot run program "hostname.exe": The system cannot find the path specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1051)
at RedirectWithLongFilename.main(RedirectWithLongFilename.java:37)
Caused by: java.io.IOException: The system cannot find the path specified
at java.lang.ProcessImpl.openForAtomicAppend(Native Method)
at java.lang.ProcessImpl.newFileOutputStream(ProcessImpl.java:71)
at java.lang.ProcessImpl.start(ProcessImpl.java:121)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1030)
... 1 more
The IOException is misleadingly stating "Cannot find the file specified", e.g.:
Exception in thread "main" java.io.IOException: Cannot run program "hostname.exe": The system cannot find the path specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1051)
at RedirectWithLongFilename.main(RedirectWithLongFilename.java:37)
Caused by: java.io.IOException: The system cannot find the path specified
at java.lang.ProcessImpl.openForAtomicAppend(Native Method)
at java.lang.ProcessImpl.newFileOutputStream(ProcessImpl.java:71)
at java.lang.ProcessImpl.start(ProcessImpl.java:121)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1030)
... 1 more
- backported by
-
JDK-8084502 (process) ProcessBuilder redirecting output to file should work with long file names (win)
-
- Resolved
-