全新IntelliJ IDEA安装中的Gradle同步失败 [英] Gradle Sync Failure in Fresh IntelliJ IDEA Install

查看:517
本文介绍了全新IntelliJ IDEA安装中的Gradle同步失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个新的MBP(16英寸2019).下载了IntelliJ IDEA Ultimate 2020.1.1的新副本.使用SDKMan安装Java 11-zulu和最新的Gradle 6.4.转到File-> New-Project并选择Gradle.加载时,出现Sync错误,并且gradle无法在IntelliJ中正确处理.从CLI一切正常,我尝试导入现有的gradle项目,不同的Java和Gradle版本,都给出相同的模糊错误.

I have a new MBP (16" 2019). Downloaded a fresh copy of IntelliJ IDEA Ultimate 2020.1.1. Used SDKMan to install Java 11-zulu and latest Gradle, 6.4. Went to File->New-Project and chose Gradle. When it loads, I get a Sync error and gradle won't process in IntelliJ correctly. Everything works fine from the CLI. I tried with importing an existing gradle project, different Java and Gradle versions, all give the same vague error.

idea.log

起因: org.gradle.launcher.daemon.client.DaemonConnectionException:新 创建的守护进程具有与预期不同的上下文.不会的 可以重新连接到该守护程序.上下文不匹配:Java主页 不一样.

Caused by: org.gradle.launcher.daemon.client.DaemonConnectionException: The newly created daemon process has a different context than expected. It won't be possible to reconnect to this daemon. Context mismatch: Java home is different.

我已经看到了其他与此相关的问题,但是这些解决方案都不适合我,而且在OSX上使用IDEA十年后,我再也没有遇到过这个问题.

I've seen other questions about this but none of those solutions are working for me and I've never had this issue before, 10 years of using IDEA on OSX.

推荐答案

此问题很可能是由于在IntelliJ IDEA中为JDK指定的Java主路径不正确而引起的.确保它指向正确的位置,例如:

The issue is likely caused by the incorrect Java home path specified for the JDK in IntelliJ IDEA. Make sure it points to the correct location like this:

/Users/rob/.sdkman/candidates/java/14.0.1-zulu/zulu-14.jdk/Contents/Home

在macOS /Contents/Home上,部分路径很重要.

On macOS /Contents/Home part of the path is significant.

这篇关于全新IntelliJ IDEA安装中的Gradle同步失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆