This is an automated email from the ASF dual-hosted git repository.

tvalentyn pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 63aecf2dc67 Add JVM arguments to fix hadoop-format tests on JDK 17+ 
(#39283)
63aecf2dc67 is described below

commit 63aecf2dc6744931011f3cda134d3f84eae43c4a
Author: tvalentyn <[email protected]>
AuthorDate: Fri Jul 10 11:44:02 2026 -0700

    Add JVM arguments to fix hadoop-format tests on JDK 17+ (#39283)
---
 sdks/java/io/hadoop-format/build.gradle | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/sdks/java/io/hadoop-format/build.gradle 
b/sdks/java/io/hadoop-format/build.gradle
index 73fc44a0f31..83dfcf22d86 100644
--- a/sdks/java/io/hadoop-format/build.gradle
+++ b/sdks/java/io/hadoop-format/build.gradle
@@ -202,3 +202,24 @@ static def createTaskNames(Map<String, String> 
hadoopVersions, String suffix) {
       .map{num -> "runHadoopFormatIO$num$suffix"}
       .collect(Collectors.toList())
 }
+
+def testJavaVer = project.findProperty('testJavaVersion') ?: 
JavaVersion.current().getMajorVersion()
+def isJava17OrHigher = testJavaVer.toInteger() >= 17
+
+tasks.withType(Test).configureEach {
+  if (isJava17OrHigher) {
+    systemProperty 'java.security.manager', 'allow'
+  }
+  // Open and export modules for embedded Cassandra and Elasticsearch under 
Java 17+
+  jvmArgs '--add-exports=java.base/sun.nio.ch=ALL-UNNAMED',
+          '--add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED',
+          '--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED',
+          '--add-opens=java.base/sun.nio.ch=ALL-UNNAMED',
+          '--add-opens=java.base/java.lang=ALL-UNNAMED',
+          '--add-opens=java.base/java.util=ALL-UNNAMED',
+          '--add-opens=java.base/java.util.concurrent=ALL-UNNAMED',
+          '--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED',
+          '--add-opens=java.base/java.io=ALL-UNNAMED',
+          '--add-opens=java.base/java.net=ALL-UNNAMED',
+          '--add-opens=java.base/java.nio=ALL-UNNAMED'
+}

Reply via email to