[英]Android Studio 3.4 build fails with openJDK
OS: Debian Stretch操作系统:Debian Stretch
Android Studio 3.4安卓工作室 3.4
JDK: open jdk 1.8 JDK:打开jdk 1.8
My Android studio build fails with following error:我的 Android Studio 构建失败并出现以下错误:
Cannot find System Java Compiler.
找不到系统 Java 编译器。 Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
确保您已经安装了 JDK(不仅仅是 JRE)并将您的 JAVA_HOME 系统变量配置为指向相应的目录。
I set JAVA_HOME, STUDIO_JDK etc and tried various tricks with openjdk , with no luck.我设置了 JAVA_HOME、STUDIO_JDK 等,并尝试了 openjdk 的各种技巧,但没有成功。
My default JRE is set to default as recommended我的默认 JRE 按照建议设置为默认值
I am trying to update default JDK location as follow which given another error:我正在尝试更新默认的 JDK 位置,如下所示,它给出了另一个错误:
Already killed couple of hours to resolve this issue.已经杀死了几个小时来解决这个问题。 So give android studio 3.4, my questions are:
所以给android studio 3.4,我的问题是:
Edit I found later that the issue was , debian stretch installed jvm only.编辑我后来发现问题是,debian stretch 只安装了 jvm。 I tried to run
javac -version
which fails since by default stretch got jre only.我试图运行
javac -version
失败,因为默认情况下,stretch 只得到 jre。 Later I fixed by installing openjdk-8-jdk which fixed the issue:后来我通过安装 openjdk-8-jdk 解决了这个问题:
sudo apt-get install openjdk-8-jdk
javac -version
javac 1.8.0_212
javac 1.8.0_212
I had the same error and while i parsing google i found an interesting site.我有同样的错误,当我解析谷歌时,我发现了一个有趣的网站。 In a lot of water i read the main information(in my opinion):
在很多水中,我阅读了主要信息(在我看来):
Android Studio requires Oracle Java 1.6 or later.
Android Studio 需要 Oracle Java 1.6 或更高版本。 It won't work with OpenJDK.
它不适用于 OpenJDK。
I think we need to download oracle, becuase i see you are using java v 1.8 like me.我认为我们需要下载 oracle,因为我看到您像我一样使用 java v 1.8。 I didn't try that, but i think it will work.
我没有尝试过,但我认为它会起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.