从命令行,我可以执行此操作并获得预期的输出
c:\Users\SomeUser\SomePath\sandbox> javac Sandbox.java
如果我将SConstruct与scons一起使用,则在同一位置,我得到
c:\Users\SomeUser\SomePath\sandbox> scons
scons: done reading SConscript files.
scons: Building targets ...
javac -d classes -sourcepath . Sandbox.java
'javac' is not recognized as an internal or external command,
operable program or batch file.
scons: *** [classes\Sandbox.class] Error 1
scons: building terminated because of errors.
答案 0 :(得分:1)
这似乎是http://scons.org/faq.html上“常见问题”常见问题解答排名第一的答案,可以帮助您解决问题。默认情况下,SCons不会从周围的shell环境中导入$PATH
等变量。您必须提取$PATH
以明确正确检测javac
可执行文件...请查看上述常见问题解答条目,以便更详细地讨论事情原因,以及如何提供所需信息{ {1}}构建环境的定义。