You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.io.IOException: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified if the path to javac contains space
#510
Closed
OlegYch opened this issue
Jul 27, 2012
· 5 comments
set PATH=d:\Distrib\Coding\Java\scala\sbt;d:\cygwin\bin;d:\cygwin\bin;c:\windows\system32; D:\Distrib\Coding\Java\jdk\jdk1.7.0_05\x86\bin
which javac
javac is an external : D:\Distrib\Coding\Java\jdk\jdk1.7.0_05\x86\bin\javac.EXE
xsbt clean compile
...
java.io.IOException: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified
...
set PATH=d:\Distrib\Coding\Java\scala\sbt;d:\cygwin\bin;d:\cygwin\bin;c:\windows\system32;D:\Distrib\Coding\Java\jdk\jdk1.7.0_05\x86\bin
xsbt clean compile
...
[success]
The text was updated successfully, but these errors were encountered:
I think this is a bug at a lower level, perhaps java.lang.ProcessBuilder. sbt doesn't parse the PATH variable. It runs the javac program without a prefix via ProcessBuilder. I don't remember the exact reason for the special casing of forking git in c5e3164, but perhaps @jsuereth can comment on whether this is the same problem.
If you specify javaHome explicitly (such as in your ~/.sbt/global.sbt configuration file), it will construct the path to the binary directly. I expect that would be a suitable workaround.
Hi, everybody.
I've found the cause. I'm using tcc/le and it was applying some special logic to fix such a broken PATH, so i was able to use javac from command line. This of course did not affect ProcessBuilder API.
Thanks for your attetntion!
SBT 0.11.3 windows
The text was updated successfully, but these errors were encountered: