通过Gradle导入项目时发现无效的JDK配置 [英] Invalid JDK configuration found, while importing a project via Gradle
问题描述
我已经安装了IntelliJ,并且需要导入Gradle项目.
I have installed IntelliJ and I need to import a Gradle project.
我已经使用gradlew build命令在命令提示符下构建了gradle项目.
I have build the gradle project using command prompt with the gradlew build command.
在IntelliJ欢迎页面上,我已经按照正确的说明进行了操作,当我选择完成"时.我收到以下错误:
At the IntelliJ welcome page, I have proceeded with proper instructions, and when I choose "Finish". I get the following error:
发现无效的Gradle JDK配置.未设置打开Gradle设置" JAVA_HOME环境变量.
Invalid Gradle JDK configuration found. Open Gradle Settings JAVA_HOME ennvironment variable not set.
当我单击打开Gradle设置"时,它弹出并出现错误,找不到错误,并在程序文件中的IntelliJ目录下找到一个路径,并在jre/jre/bin/.... etc中搜索.
When I click on "Open Gradle Settings" it pop up with error of Not found with a path under IntelliJ directory in Program files and searching in jre/jre/bin/....etc.
推荐答案
刚刚找到了解决方案:
- 创建一个空的Gradle项目,然后转到项目结构"并检查JDK的路径(该路径应该是有效的,如果不是,则可以添加自己的路径).
- 然后构建这个空项目,等待并完成,关闭IntelliJ.
- 重新启动它并尝试导入/打开您的Gradle项目,现在它应该可以工作了.
这篇关于通过Gradle导入项目时发现无效的JDK配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!