Use java option '--illegal-access=debug' for jdk 11.
@@ -244,6 +244,13 @@ import_cfg_var () {
fi
}
+# TODO Vespa 8: Remove when all containers use JDK 17
+configure_illegal_access() {
+ if [[ "$VESPA_JDK_VERSION" = "11" ]]; then
+ illegal_access_option="--illegal-access=debug"
+ fi
+}
+
getconfig
configure_memory
configure_gcopts
@@ -252,6 +259,7 @@ configure_classpath
configure_numactl
configure_cpu
configure_preload
+configure_illegal_access
exec $numactlcmd $envcmd java \
-Dconfig.id="${VESPA_CONFIG_ID}" \
@@ -265,6 +273,7 @@ exec $numactlcmd $envcmd java \
-XX:HeapDumpPath="${VESPA_HOME}/var/crash" \
-XX:ErrorFile="${VESPA_HOME}/var/crash/hs_err_pid%p.log" \
-XX:+ExitOnOutOfMemoryError \
+ ${illegal_access_option} \
--add-opens=java.base/java.io=ALL-UNNAMED \
--add-opens=java.base/java.lang=ALL-UNNAMED \
--add-opens=java.base/java.net=ALL-UNNAMED \
