java - 安卓工作室 : "Gradle sync failed: Could not run JVM from the selected JDK."

标签 java android android-gradle-plugin

自从装了Android Studio 3.2,一直跑不了Java,试过jdk-8u181-windows-x64, jdk-10.0.2_windows-x64_bin, jdk-11_windows-x64_bin, 设置PATH 并重新安装所有东西无数次,结果都是一样的——没有出现“java”,错误信息是:-

Gradle sync failed: Could not run JVM from the selected JDK. Please ensure JDK installation is valid and compatible with the current OS (Windows 8.1 6.3, amd64). If you are using embedded JDK, please make sure to download Android Studio bundle compatible with the current OS. For example, for x86 systems please choose a 32 bits download option. (369 ms)

笔记:我​​以前可以打开java文件夹,但玩多了,出了点问题,所以,我决定重新开始......从此我就死了。

Studio 3.2 有缺陷吗?与 Java 完全不兼容?或者我错过了什么?有没有我可以测试的旧版 Android Studio?感谢您提供的任何帮助。

最佳答案

在我的例子中,以下解决了它:

文件->其他设置->默认项目结构...

在“JDK Location”中,我之前选择了oracle jdk。为了解决这个问题,我改为选中“使用嵌入式 JDK(推荐)”

Android Studio JDK location setting

关于java - 安卓工作室 : "Gradle sync failed: Could not run JVM from the selected JDK.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52584625/

相关文章:

android - Gradle 重复条目 : java. util.zip.ZipException

java - 有什么方法可以使用 JAX-WS 从 Javadoc 生成 WSDL 文档?

java - 在网络服务之间共享数据的最佳方式

Android action.MAIN 和 category.LAUNCHER 函数

java - Android 应用程序中的穆斯林祈祷时间是如何计算的?

android - resValue 梯度错误 : Unsupported type "String" in "generated.xml"

java - String 方法的返回值

java - 为什么我的快速排序性能比合并排序差?

java - 如何创建可打包的二维可打包数组?

android-studio - Gradle在 list 合并 "targetApi"时失败