Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check configured JavaLauncher when determining version of the JVM
Previously, bootRun assumed that the Java version of the JVM that would run the application would be the same as the Java version of the JVM that is running the build. This assumption does not hold true when Gradle's toolchain support is used to configure tasks that fork a new JVM to use a version other than that being used by Gradle itself. This commit updates the BootRun task to query the JavaLauncher property when determining the version of Java on which the application will be run. Toolchain support and the JavaLauncher property are new in Gradle 6.7. To support earlier versions of Gradle, NoSuchMethodError is caught we continue as if no JavaLauncher has been configured and use the local JVM's Java version. Fixes gh-24512
- Loading branch information