Skip to content

Commit ac0b9c1

Browse files
committed
Set Java source & target compatibility to JDK 21 in Eclipse
This ensures that all code (including tests and the API tools in the 'documentation' project that make use of JDK 21 language features) is compiled as if we were targeting JDK 21 instead of JDK 17. Note, however, that this only affects the projects within Eclipse. The standard Gradle build will still fail if somebody inadvertently uses language features or APIs post JDK 17.
1 parent d7ca58c commit ac0b9c1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gradle/plugins/common/src/main/kotlin/junitbuild.java-library-conventions.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ val extension = extensions.create<JavaLibraryExtension>("javaLibrary")
3434

3535
eclipse {
3636
jdt {
37+
sourceCompatibility = JavaVersion.VERSION_21
38+
targetCompatibility = JavaVersion.VERSION_21
3739
file {
3840
// Set properties for org.eclipse.jdt.core.prefs
3941
withProperties {

0 commit comments

Comments
 (0)