Fix launching older Forge versions (#3920)

This commit is contained in:
Josiah Glosson
2025-07-06 14:09:49 -05:00
committed by GitHub
parent e5b134f8f4
commit 31ecace083
2 changed files with 16 additions and 2 deletions

View File

@@ -619,6 +619,12 @@ pub async fn launch_minecraft(
.into_iter(),
);
// The java launcher requires access to java.lang.reflect in order to force access in to
// whatever module the main class is in
if java_version.parsed_version >= 9 {
command.arg("--add-opens=java.base/java.lang.reflect=ALL-UNNAMED");
}
// The java launcher code requires internal JDK code in Java 25+ in order to support JEP 512
if java_version.parsed_version >= 25 {
command.arg("--add-opens=jdk.internal/jdk.internal.misc=ALL-UNNAMED");