Har*_*ran 23 android android-support-library android-studio
我试图从Android工作室运行我的应用程序时遇到以下错误
Execution failed for task ':app:compileDebugJava'. 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.
在网上搜索后,我发现了一些这样的解决方案
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_45/
Run Code Online (Sandbox Code Playgroud)
所以我在android studio dirctory的终端中给出了这个命令但是它没有锻炼它再次显示相同的错误.
eat*_*ons 71
更新我的Gradle构建版本对我来说很有用.
旧:
classpath 'com.android.tools.build:gradle:1.0.0'
Run Code Online (Sandbox Code Playgroud)
新:
classpath 'com.android.tools.build:gradle:2.2.3'
Run Code Online (Sandbox Code Playgroud)
编辑:由于此答案仍然经常使用,请注意Gradle 2.2.3可能可以替换为任何较新版本的Gradle.这个版本恰好是我最初回答问题时使用的版本.
Har*_*ran 50
在你的android-studio中,在File-> Other Settings-> Default Project Structure-> SDKs中找到它.然后我改变了JDK的主路径.
小智 5
要在Andriod Studio 2.3.1中修复此错误,我必须转到File > Project Structure或Ctrl+ Alt+ Shift+ S然后转到已经打开的SDK位置,然后取消选中"使用嵌入式JDK"并指向我安装的版本所在的位置.
| 归档时间: |
|
| 查看次数: |
63448 次 |
| 最近记录: |