The `JavaTask` used by SourceLauncher by default passes jtreg-added flags to the java launcher. This is fine for the most part except when the source launcher specifies `--source` which conflicts with `--enable-preview`. We can use `includeStandardOptions(false)` to prevent such passing.
The other uses of `vmOpions` are all true vm options and thus can inherit options. The same failure happens on mainline. We might port this to mainline later. ------------- Commit messages: - 8379820: [lworld] tools/javac/launcher/SourceLauncherTest.java fails with error: release version 21 not supported Changes: https://git.openjdk.org/valhalla/pull/2216/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=2216&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8379820 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod Patch: https://git.openjdk.org/valhalla/pull/2216.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2216/head:pull/2216 PR: https://git.openjdk.org/valhalla/pull/2216
