Documentation mistake: options.bootclasspath works without option.fork=true

The documentation for CompileOptions [1] defines the bootclasspath as

The bootstrap classpath to be used for the compiler process. Only takes effect if fork is true.

I’ve asked why fork was still needed on both this forum [2] and stackoverflow [3] without getting any answer (it used to be true for old version of gradle).

I’ve successfully tested that errors are correctly raised without options.fork = true:

  • sourceCompatibility=1.6 and jdk6 rt.jar raise an error for the java 7 specific Character.isAlphabetic
  • sourceCompatibility=1.7 and jdk7 rt.jar raise an error for the java 8 specific Arrays.stream

So I would suggest to remove the statement on fork from this documentation.

[1 ] https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.CompileOptions.html#org.gradle.api.tasks.compile.CompileOptions:bootClasspath
[2] https: //discuss.gradle.org/t/why-option-fork-is-still-necessary-to-set-bootclasspath/9740
[3] http: //stackoverflow.com/questions/30345778/is-option-fork-still-necessary-to-set-bootclasspath
Why option.fork is still necessary to set bootClasspath?

Apologies for the late response. Thanks for bringing this to our attention. You are correct, that comment in the javadocs is inaccurate. In fact, the same applied to the extensionDirs property. This has been fixed for Gradle 2.6.