From d14c7c94aa21c6fb6d87a19078bca9c9f783dd7e Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Thu, 8 Apr 2021 18:36:45 +0200 Subject: [PATCH] Fix forge on Java 16 and higher. --- forge/build.gradle.kts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index 54ac740..7a05910 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -4,4 +4,17 @@ dependencies { implementation(project(path = ":common")) { isTransitive = false } add("developmentForge", project(path = ":common")) { isTransitive = false } shadowC(project(path = ":common", configuration = "transformProductionForge")) { isTransitive = false } -}; loom { useFabricMixin = true } +}; loom { + useFabricMixin = true + if (JavaVersion.current().isJava9Compatible) { + runs { + val args: List = listOf("--illegal-access=permit") + if (JavaVersion.current() < JavaVersion.VERSION_17) { + listOf("--add-exports java.base/sun.security.util=ALL-UNNAMED", "--add-opens java.base/java.util.jar=ALL-UNNAMED") + } + this.forEach { + it.vmArgs(args) + } + } + } +} \ No newline at end of file