Skip to content

Commit

Permalink
set sourceCompatibility to 21
Browse files Browse the repository at this point in the history
  • Loading branch information
ZZZank committed May 31, 2024
1 parent 7ddefb9 commit d2e1fb3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version = project.mod_version
group = project.maven_group

java {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_21
}

loom {
Expand Down Expand Up @@ -131,15 +131,12 @@ tasks.withType(JavaCompile) {
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too.
options.encoding = "UTF-8"
sourceCompatibility = 16
sourceCompatibility = 21

// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 8
if (JavaVersion.current().isJava9Compatible()) {
options.release = targetVersion
}
options.release = 8
}

java {
Expand Down

0 comments on commit d2e1fb3

Please sign in to comment.