scala IOException: 无法运行程序 "javac": CreateProcess error=2,系统找不到指定的文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18957486/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 05:42:53  来源:igfitidea点击:

IOException: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified

scalaplay2-mini

提问by joescii

I got the error "IOException: Cannot run program "javac": CreateProcess error=2, The system cannot find the file specified" while running my scala project in play 2. why does this error occur . Please solve this problem.

我在 play 2 中运行我的 Scala 项目时收到错误“IOException:无法运行程序“javac”:CreateProcess 错误=2,系统找不到指定的文件。为什么会发生此错误。请解决这个问题。

回答by joescii

Check that you have the environment variable JAVA_HOME defined and set to the root directory of your JDK (not just a JRE, which doesn't include javac)

检查您是否定义了环境变量 JAVA_HOME 并将其设置为 JDK 的根目录(不仅仅是 JRE,它不包括 javac)

回答by joescii

for anyone who googles this error when using xml beans (I was forced to maintain an old app that uses xmlbeans and got this error), use jdk 5 and not higher for xmlbeans and this error goes away

对于在使用 xml bean 时搜索此错误的任何人(我被迫维护一个使用 xmlbeans 的旧应用程序并出现此错误),请使用 jdk 5 而不是更高版本的 xmlbeans 并且此错误消失