Android Studio - 任务 compileReleaseJavaWithJavac 执行失败
Android Studio - Execution failed for task compileReleaseJavaWithJavac
我用 Android Studio
打开了一个分为 6 个模块的旧项目,但它总是在构建任务中失败。
我的环境是:
Ubuntu 14.04
OpenJDK7
Android Studio 2.2 preview 2
大多数模块的构建都失败了,并告诉我它找不到 Java 编译器,这是错误跟踪:
What went wrong:
Execution failed for task ':maskable_layout:compileReleaseJavaWithJavac'.
Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
我确定我的机器上安装了 JDK,我尝试安装 Oracle Java
并在我的配置文件 .bachrc
中修改 JAVA_HOME
,但错误没有'消失。
答案是回到旧版本Android Studio 2.1
。
这似乎是新 Android Studio
的问题,现在我在旧版本上运行良好。
我用 Android Studio
打开了一个分为 6 个模块的旧项目,但它总是在构建任务中失败。
我的环境是:
Ubuntu 14.04
OpenJDK7
Android Studio 2.2 preview 2
大多数模块的构建都失败了,并告诉我它找不到 Java 编译器,这是错误跟踪:
What went wrong:
Execution failed for task ':maskable_layout:compileReleaseJavaWithJavac'.
Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
我确定我的机器上安装了 JDK,我尝试安装 Oracle Java
并在我的配置文件 .bachrc
中修改 JAVA_HOME
,但错误没有'消失。
答案是回到旧版本Android Studio 2.1
。
这似乎是新 Android Studio
的问题,现在我在旧版本上运行良好。