Switch to Java 17
Uses the new Java toolchain feature of Gradle to acquire Java 17. Doing it this way means that you can start ./gradlew under any version of Java and still use Java 17 for the build; it picks a candidate from the environment or downloads one if required. It also takes care of source and target compatibility, with the exception of ide.gradle which is handled separately.
This commit is contained in:
@@ -134,8 +134,11 @@ subprojects { subproject ->
|
||||
|
||||
apply from: "${rootProject.projectDir}/publish-maven.gradle"
|
||||
|
||||
sourceCompatibility=1.8
|
||||
targetCompatibility=1.8
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(17)
|
||||
}
|
||||
}
|
||||
|
||||
[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"]
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import org.gradle.plugins.ide.eclipse.model.SourceFolder
|
||||
apply plugin: "eclipse"
|
||||
|
||||
eclipse.jdt {
|
||||
sourceCompatibility = 1.8
|
||||
targetCompatibility = 1.8
|
||||
sourceCompatibility = 17
|
||||
targetCompatibility = 17
|
||||
}
|
||||
|
||||
// Replace classpath entries with project dependencies (GRADLE-1116)
|
||||
|
||||
Reference in New Issue
Block a user