[英]Gradle JAVA_HOME path in eclipse
I have a problem running Gradle project in eclipse Neon.2.我在 eclipse Neon.2 中运行 Gradle 项目时遇到问题。 I find out that there is a problem with JDK path.
我发现JDK路径有问题。 Somehow my gradle in elipse always use some strange JRE as a Java Home, when it should use a path to a JDK.
不知何故,我在 elipse 中的 gradle 总是使用一些奇怪的 JRE 作为 Java Home,当它应该使用 JDK 的路径时。 I double checked my settings in eclipse and system variables, but still i cant find the solution.
我在 eclipse 和系统变量中仔细检查了我的设置,但仍然找不到解决方案。
I searched for answers and find out that people suggested changing Gradle settings in elipse.我搜索了答案,发现人们建议在 elipse 中更改 Gradle 设置。 I did all the settings but it still doesnt work.
我做了所有设置,但它仍然不起作用。
Btw, if I manualy set the Java Home while creating Gradle project it all works fine.顺便说一句,如果我在创建 Gradle 项目时手动设置 Java Home,一切正常。 But it has to work on other computers so I cant really use that solution.
但它必须在其他计算机上运行,所以我无法真正使用该解决方案。
Create/update gradle.properties in GRADLE_USER_HOME ( C:\users\<user>/.gradle or linux ~/.gradle) with
org.gradle.java.home=<path to jdk>
In Preference of Eclipse (main menu: Window -> Preferences), select在 Eclipse 的 Preference(主菜单:Window -> Preferences)中,选择
Gradle -> Arguments -> Java Home, select "Workspace JRE". Gradle -> Arguments -> Java Home,选择“Workspace JRE”。
Then select one of your jdk in your workspace.然后在您的工作区中选择您的 jdk 之一。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.