DaemonParameters does not support JDK 9 by default

After installing JDK 9 (build 1.9.0-ea-b53) on my Mac, the Spring Framework build fails with the following error:

Unrecognized VM option ‘MaxPermSize=256m’ Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

However, the Spring Framework build does not set the MaxPermSize JVM argument.

It appears that DaemonParameters is the culprit since it sets default JVM arguments that are incompatible with JDK 9.

Adding the following to gradle.properties serves as a temporary work around:

org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m -Xmx1024m

However, I would consider this a bug.

Gradle’s DaemonParameters should detect that the current JDK is greater than 1.8 and set the default JVM arguments accordingly.

Thanks for the report, raised as GRADLE-3256.