Skip to content

Commit

Permalink
[Java] Add missing --add-opens.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyazelenko committed Dec 18, 2024
1 parent 6ae3dbe commit 87dff93
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.RegisterExtension;
Expand All @@ -63,7 +62,6 @@
import java.time.Duration;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -461,12 +459,10 @@ private String[] deriveCommand(
IoUtil.delete(clusterDir, false);
IoUtil.ensureDirectoryExists(clusterDir, "cluster base directory");

if (isVersionAfterJdk8())
{
command.add("--add-opens");
command.add("java.base/sun.nio.ch=ALL-UNNAMED");
}

command.add("--add-opens");
command.add("java.base/jdk.internal.misc=ALL-UNNAMED");
command.add("--add-opens");
command.add("java.base/java.util.zip=ALL-UNNAMED");
command.add("-Xmx32m");
command.add("-cp");
command.add(FileResolveUtil.resolveAeronAllJar().getAbsolutePath());
Expand Down Expand Up @@ -501,9 +497,4 @@ private String[] deriveCommand(

return command.toArray(new String[0]);
}

private static boolean isVersionAfterJdk8()
{
return EnumSet.range(JRE.JAVA_9, JRE.OTHER).contains(JRE.currentVersion());
}
}

0 comments on commit 87dff93

Please sign in to comment.