Skip to content

Commit

Permalink
[MCOMPILER-534] Document conditional setting of the --release property
Browse files Browse the repository at this point in the history
  • Loading branch information
aherbert committed Apr 25, 2023
1 parent 546a322 commit 4798b20
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/site/apt/examples/set-compiler-release.apt.vm
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,30 @@ Setting the <<<--release>>> of the Java Compiler
since Java 9. As such, the release number does not start with 1.x anymore. Also note that the
supported <<<release>>> targets include the release of the currently used JDK plus a limited number
of previous releases.

* Usage on JDK 8

The <<<--release>>> option is used to target an older Java release than the JDK used during the
build process. This flag is not supported using JDK 8. To enable a project that targets Java 8
to be built using JDK 8 or later requires the conditional usage of the <<<--release>>> option.
This may be done through the use of a profile:

+-----
<project>
[...]
<profiles>
[...]
<profile>
<id>set-compiler-release</id>
<activation>
<jdk>[9,)</jdk>
</activation>
<properties>
<maven.compiler.release>8</maven.compiler.release>
</properties>
</profile>
[...]
</profiles>
[...]
</project>
+-----

0 comments on commit 4798b20

Please sign in to comment.