From 05ce4e86bfde13af1e74841c26465fae0c8ee230 Mon Sep 17 00:00:00 2001 From: Maik Marschner Date: Sat, 25 Jul 2026 23:34:17 +0200 Subject: [PATCH 1/2] Update lib and launcher to Java 17. --- build.gradle | 2 +- launcher/build.gradle | 11 +++++++++-- lib/build.gradle | 12 ++++++++++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 950a0d99b..cffaaf328 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ subprojects { java { toolchain { - // default java version for the project, some subprojects are pinned to java 8 for backwards compatibility (see their configs). + // default java version for the project languageVersion = JavaLanguageVersion.of(17) } } diff --git a/launcher/build.gradle b/launcher/build.gradle index 675b1e2c8..26b483e1f 100644 --- a/launcher/build.gradle +++ b/launcher/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'application' +apply plugin: 'org.openjfx.javafxplugin' mainClassName = 'se.llbit.chunky.launcher.ChunkyLauncher' @@ -20,11 +21,17 @@ dependencies { java { toolchain { - languageVersion = JavaLanguageVersion.of(8) // pinned to java 8 for backwards compatibility - vendor = JvmVendorSpec.AMAZON // using corretto as it's one of few jdks to include jfx (on windows+linux) and isn't oracle + // keep this pinned to java 17 for backwards compatibility even if we update to Java 25 in Chunky 2.6 + languageVersion = JavaLanguageVersion.of(17) } } +javafx { + version = '17' + configuration = 'implementation' + modules = ['javafx.base', 'javafx.controls', 'javafx.fxml'] +} + sourceSets { main { java { diff --git a/lib/build.gradle b/lib/build.gradle index 41cfe7ea7..8837fc3e7 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -1,3 +1,5 @@ +apply plugin: 'org.openjfx.javafxplugin' + sourceSets.main.java { srcDir 'src' } @@ -8,7 +10,13 @@ configurations { java { toolchain { - languageVersion = JavaLanguageVersion.of(8) // pinned to java 8 for backwards compatibility - vendor = JvmVendorSpec.AMAZON // using corretto as it's one of few jdks to include jfx (on windows+linux) and isn't oracle + // keep this pinned to java 17 for backwards compatibility even if we update to Java 25 in Chunky 2.6 + languageVersion = JavaLanguageVersion.of(17) } } + +javafx { + version = '17' + configuration = 'implementation' + modules = ['javafx.base', 'javafx.controls', 'javafx.fxml'] +} From bc448982e0746fd0c5eb67846e4690f4376020f6 Mon Sep 17 00:00:00 2001 From: Maik Marschner Date: Sat, 25 Jul 2026 23:38:00 +0200 Subject: [PATCH 2/2] Remove obsolete error handling for Java 8. Related to #1408 --- .../java/se/llbit/chunky/resources/ResourcePackLoader.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/chunky/src/java/se/llbit/chunky/resources/ResourcePackLoader.java b/chunky/src/java/se/llbit/chunky/resources/ResourcePackLoader.java index e1c88eea4..ccc10feec 100644 --- a/chunky/src/java/se/llbit/chunky/resources/ResourcePackLoader.java +++ b/chunky/src/java/se/llbit/chunky/resources/ResourcePackLoader.java @@ -224,10 +224,6 @@ public static FileSystem getPackFileSystem(File pack) throws IOException { ? FileSystems.getDefault() // for resource packs in jar or zip files : FileSystems.newFileSystem(URI.create("jar:" + pack.toURI()), Collections.emptyMap()); - } catch (ZipError e) { - // This catch is required for Java 8. This error appears safe to catch. - // https://stackoverflow.com/a/51715939 - throw new IOException(e); } catch (FileSystemAlreadyExistsException e) { // for resource packs in jar or zip files (re-use existing fs) return FileSystems.getFileSystem(URI.create("jar:" + pack.toURI()));