Tooling API: ISE with message: Cannot use Gradle installation 'C:\Users\Matt\gradle-2.7' as it has been stopped

HI,
I’m starting to use the Tooling API, but whenever I try to run a build I got an unexpected IllegalStateException:

java.lang.IllegalStateException: Cannot use Gradle installation ‘C:\Users\Matt\gradle-2.7’ as it has been stopped.
at org.gradle.internal.concurrent.ServiceLifecycle.use(ServiceLifecycle.java:56) ~[gradle-tooling-api-2.4.jar:2.4]
at org.gradle.internal.concurrent.ServiceLifecycle.use(ServiceLifecycle.java:46) ~[gradle-tooling-api-2.4.jar:2.4]
at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor.run(DefaultAsyncConsumerActionExecutor.java:49) ~[gradle-tooling-api-2.4.jar:2.4]
at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:76) ~[gradle-tooling-api-2.4.jar:2.4]
at org.gradle.tooling.internal.consumer.DefaultBuildLauncher.run(DefaultBuildLauncher.java:70) ~[gradle-tooling-api-2.4.jar:2.4]
at com.mab.jde.project2.gradle.GradleExecutor.build(GradleExecutor.java:102) ~[main/:?]
at com.mab.jde.project2.gradle.GradleProject.build(GradleProject.java:66) ~[main/:?]
at com.mab.jde.project2.IProject.build(IProject.java:28) ~[main/:?]
at com.mab.jde.MainMenuFactory.lambda$get$27(MainMenuFactory.java:111) ~[main/:?]


getProjectConnection()
.newBuild()
.forTasks(“task”)
.run();

The code does not run with the default gradle environment neither.
Thanks for any hint!
Muggen

what is getProjectConnection() doing? can you share a reproducable example? what version of tooling api and what distribution are you using?

After long testing and searching I think I know what’s the problem. It seems that the connect() method of the GradleConnector class does not startup the gradle deamon. When I want to connect to gradle on a later point the deamon is missing and that’s the source of the unexpected exception.
That comes from an interference with my JavaFx application. When I move the initialization of the gradle infrastructure after the JavaFx initialization I’m good.
I’m still searching, but this fix helped me for now.
Thanks once again for your help! Appreciate it.