Skip to content

Commit 97eff5e

Browse files
committed
Added support for running tests on Java 17
A note will be added to the docs as well for this, but in a future PR as I'm reorganizing the docs in a separate PR right now.
1 parent 4d09e57 commit 97eff5e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ test {
4343
environment "mlHost", mlHost
4444
}
4545

46+
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
47+
test {
48+
// See https://stackoverflow.com/questions/72724816/running-unit-tests-with-spark-3-3-0-on-java-17-fails-with-illegalaccesserror-cl
49+
// for an explanation of why these are needed when running the tests on Java 17.
50+
jvmArgs = [
51+
'--add-exports=java.base/sun.nio.ch=ALL-UNNAMED',
52+
'--add-opens=java.base/sun.util.calendar=ALL-UNNAMED'
53+
]
54+
}
55+
}
56+
4657
shadowJar {
4758
// "all" is the default; no need for that in the connector filename.
4859
archiveClassifier.set("")

0 commit comments

Comments
 (0)