Gradle JAVA_HOME path in eclipse
Solution 1
In Preference of Eclipse (main menu: Window -> Preferences), select
Gradle -> Arguments -> Java Home, select "Workspace JRE".
Then select one of your jdk in your workspace.
Solution 2
Create/update gradle.properties in GRADLE_USER_HOME ( C:\users\<user>/.gradle or linux ~/.gradle) with
org.gradle.java.home=<path to jdk>
InvictaAnima
Updated on June 30, 2022Comments
-
InvictaAnima almost 2 years
I have a problem running Gradle project in eclipse Neon.2. I find out that there is a problem with JDK path. Somehow my gradle in elipse always use some strange JRE as a Java Home, when it should use a path to a JDK. I double checked my settings in eclipse and system variables, but still i cant find the solution.
I searched for answers and find out that people suggested changing Gradle settings in elipse. 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. But it has to work on other computers so I cant really use that solution.
-
zhuhang.jasper about 6 yearsThere's no "Argument" section under Gradle for me
-
Delli Kilari about 6 yearsIt should be, Can you post some screen shot here with version your using and so.
-
zhuhang.jasper almost 6 yearsEclipse Oxygen 3a. Screenshot of Eclipse: imgur.com/cRfF2D0 Any way, I fixed it by specifying the java path in
C:\Users\YourUserName\.gradle\gradle.properties
file -
rinilnath over 2 yearsThere is no such argument in 4.7.2 oxygen version of eclispe. @zhuhang.jasper. How did you set the value in gradle.properties?
-
zhuhang.jasper over 2 years@rinilnath have you tried the above answer by mujibur-rahman ?
-
rinilnath over 2 years@zhuhang.jasper, Yes, i edited gradle.properties in my local project folder to hold the value of JDK home from my system. org.gradle.java.home=C:/Program Files/Java/JDK1.8.0.45