Debugging ProjectConnection.getModel

I’m using the Gradle Tools API to identify what tasks exist in some Gradle project. When I run


I get an exception

org.gradle.tooling.GradleConnectionException: Could not fetch model of type
'CodeAssistModel' using Gradle distribution

This exception is caused by

org.gradle.api.GradleException: Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at
Please read the following process output to find out more:

Java HotSpot™ 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

I found a daemon-281.out.log file in $gradleHome/daemon/3.2, it reads

21:50:48.480 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonMain] Assuming the daemon was started with following jvm opts: [-XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=US-ASCII,,, -Duser.language=en, -Duser.variant]
21:50:48.530 [ERROR] [system.err]
21:50:48.531 [ERROR] [system.err] FAILURE: Build failed with an exception.
21:50:48.537 [ERROR] [system.err]
21:50:48.538 [ERROR] [system.err] * What went wrong:
21:50:48.538 [ERROR] [system.err] Could not create service of type FileSystem using FileSystemServices.createFileSystem().
21:50:48.539 [ERROR] [system.err]
21:50:48.539 [ERROR] [system.err] * Try:
21:50:48.539 [ERROR] [system.err] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Daemon vm is shutting down… The daemon has exited normally or was terminated in response to a user interrupt.

I will guess that the may be the problem.

Is there some way we can run ProjectConnection.getModel so that --stacktrace, --debug, or --info will be passed to the daemon? Then we could be sure of the cause of this error. I have tried


and this seems to have no effect.

Also, is there some way I can change the jvm opts that the daemon is launched with?