You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -595,3 +595,19 @@ In other words, there should be no back-and-forth to the same repo.
595
595
Java projects may use language or runtime features which are considered _preview features_ in certain Java versions, in which case preview features must be enabled for compilation (`--enable-preview`).
596
596
This is specified using the `javaPreviewNeeded` attribute, which is a version specification in the same format as `javaCompliance`, for example: `"javaPreviewNeeded": "19..20"`
597
597
If the compiling JDK matches that version or version range, preview features are enabled for compilation.
598
+
Given that javac and the JVM must be on the same JDK version for preview features (see [here](https://nipafx.dev/enable-preview-language-features/#same-version-for-feature-compiler-and-jvm) for details),
599
+
compiling a project with preview features will force the javac `-source` and `-target` options to `N` where `N` is
600
+
the minimum of:
601
+
* the version of the JDK being used for compilation (i.e. `JAVA_HOME`) and
602
+
* the lowest version where `--enable-preview` is not needed.
603
+
604
+
The following table of examples should make this clearer:
0 commit comments