I have a simple Gradle project in Eclipse and using Buildship.
Inside build.gradle I print out java version like this
In Eclipse, I have only one JRE in Installed JREs (that points to C:/Java/JDK8). JavaSE-1.8 in Execution Environments has only a single compatible JRE - the one pointing to C:/Java/JDK8. My JAVA_HOME also points to C:/Java/JDK8.
When I run any Gradle task from Eclipse, Gradle is taking another JDK on my system (moreover, only JRE). The only way I can convince Buildship to use my wished JDK is to go to Run Configurations and in Java Home tab specify the JDK again. But this is super inconvenient to do it for every Run configuration separately.
When I execute Gradle from command line, it takes the proper one from JAVA_HOME. The problem occurs only when using Buildship.
Is there any way, how I can set Java home in Buildship globally?