Buildship not reading property in ~/.gradle/gradle.properties

All is fine when I build my project from the command line. However, when I add a dependency, and select Eclipse Gradle -> Refresh Gradle Project, the refresh fails when a property declared in ~/.gradle/gradle.properties is said to be undefined. The error line in the partial stacktrace below is for

def bootClasspathStr = java8runtime+"/jre/lib/rt.jar"

java8runtime is defined (the script works from the command line). In Eclipse I must use the full path.

I am using Neon.2 Release (4.6.2) and Buildship 1.0.21v20161010-1604. The did not exists a few weeks ago. The only new plugin I spy in the interim is the EGit plugin for Eclipse, 4.6.0.201612231935-r.

Partial stacktrace:

Synchronize Gradle builds with workspace failed due to an error in the referenced Gradle build.
Could not fetch model of type 'EclipseProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14.1-bin.zip'.

Build file '/Users/thad/experimental/myprojdir/build.gradle' line: 127
A problem occurred evaluating root project 'myprojdir'.
Could not get unknown property 'java8runtime' for object of type de.richsource.gradle.plugins.gwt.GwtPluginExtension.
org.gradle.tooling.BuildException: Could not fetch model of type 'EclipseProject' using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.14.1-bin.zip'.
  at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
  at org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
  at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
  at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:57)
  ....
Caused by: org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/thad/experimental/myprojdir/build.gradle' line: 127
A problem occurred evaluating root project 'myprojdir'.
  at org.gradle.initialization.DefaultExceptionAnalyser.transform(DefaultExceptionAnalyser.java:74)
  at org.gradle.initialization.MultipleBuildFailuresExceptionAnalyser.transform(MultipleBuildFailuresExceptionAnalyser.java:47)
  at org.gradle.initialization.StackTraceSanitizingExceptionAnalyser.transform(StackTraceSanitizingExceptionAnalyser.java:30)
  at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:100)
  ...
Caused by: org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'myprojdir'.
  at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
  at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:177)
  at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
  at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:182)
  ...
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'java8runtime' for object of type de.richsource.gradle.plugins.gwt.GwtPluginExtension.
  at org.gradle.internal.metaobject.AbstractDynamicObject.getMissingProperty(AbstractDynamicObject.java:88)
  at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:62)
  at de.richsource.gradle.plugins.gwt.GwtPluginExtension_Decorated.getProperty(Unknown Source)
  at build_9otpzfihg97yzm6nxkz61flg8$_run_closure6.doCall(/Users/thad/experimental/myprojdir/build.gradle:127)
  ...

Hi Thad,

the only explanation I have at the moment is that you might have changed the Gradle User Home in the workspace preferences.

Cheers,
Stefan

Yes, that’s it. I had wrongly set Gradle User Home to $GRADLE_HOME. When I cleared the value–so it now used the default ~/.gradle–it works fine. Thank you.