Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle JAVA_HOME path in eclipse

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.

All the settings

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.

That works fine

like image 466
InvictaAnima Avatar asked Oct 20 '25 12:10

InvictaAnima


2 Answers

Create/update gradle.properties in GRADLE_USER_HOME ( C:\users\<user>/.gradle or linux ~/.gradle) with 

org.gradle.java.home=<path to jdk>
like image 89
Mujibur Rahman Avatar answered Oct 23 '25 00:10

Mujibur Rahman


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.

like image 36
Delli Kilari Avatar answered Oct 23 '25 02:10

Delli Kilari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!