diff --git a/hibernate-core/hibernate-core.gradle b/hibernate-core/hibernate-core.gradle index f12c9c26ae..44728f23eb 100644 --- a/hibernate-core/hibernate-core.gradle +++ b/hibernate-core/hibernate-core.gradle @@ -297,6 +297,11 @@ task testJavassist(type: Test) { logger.lifecycle "Testing javassist with '${javaLauncher.get().metadata.installationPath}'" } } + + if ( gradle.ext.javaVersions.test.launcher.asInt() >= 9 ) { + // Javassist needs this to generate proxies + jvmArgs( ['--add-opens', 'java.base/java.lang=ALL-UNNAMED'] ) + } } check.dependsOn testJavassist