@@ -130,6 +130,20 @@ lazy val spark = (project in file("spark"))
130
130
Test / testOptions += Tests .Argument (" -oDF" ),
131
131
Test / testOptions += Tests .Argument (TestFrameworks .JUnit , " -v" , " -a" ),
132
132
133
+ // Copied from SparkBuild.scala to support Java 17 (see apache/spark#34153)
134
+ (Test / javaOptions) ++= Seq (
135
+ " --add-opens=java.base/java.lang=ALL-UNNAMED" ,
136
+ " --add-opens=java.base/java.lang.invoke=ALL-UNNAMED" ,
137
+ " --add-opens=java.base/java.io=ALL-UNNAMED" ,
138
+ " --add-opens=java.base/java.net=ALL-UNNAMED" ,
139
+ " --add-opens=java.base/java.nio=ALL-UNNAMED" ,
140
+ " --add-opens=java.base/java.util=ALL-UNNAMED" ,
141
+ " --add-opens=java.base/java.util.concurrent=ALL-UNNAMED" ,
142
+ " --add-opens=java.base/sun.nio.ch=ALL-UNNAMED" ,
143
+ " --add-opens=java.base/sun.nio.cs=ALL-UNNAMED" ,
144
+ " --add-opens=java.base/sun.security.action=ALL-UNNAMED" ,
145
+ " --add-opens=java.base/sun.util.calendar=ALL-UNNAMED" ),
146
+
133
147
// Don't execute in parallel since we can't have multiple Sparks in the same JVM
134
148
Test / parallelExecution := false ,
135
149
0 commit comments