The documentation for CompileOptions  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  and stackoverflow  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
 https: //discuss.gradle.org/t/why-option-fork-is-still-necessary-to-set-bootclasspath/9740
 http: //stackoverflow.com/questions/30345778/is-option-fork-still-necessary-to-set-bootclasspath
Why option.fork is still necessary to set bootClasspath?