File tree Expand file tree Collapse file tree
opendj-server-legacy/resource/bin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ set SET_ENVIRONMENT_VARS_DONE=true
173173" %OPENDJ_JAVA_BIN% " --add-opens java.base/jdk.internal.loader=ALL-UNNAMED --version > NUL 2 >& 1
174174set RESULT_CODE = %errorlevel%
175175if %RESULT_CODE% == 0 set OPENDJ_JAVA_ARGS = %OPENDJ_JAVA_ARGS% --add-opens java.base/jdk.internal.loader=ALL-UNNAMED
176+ " %OPENDJ_JAVA_BIN% " --enable-native-access=ALL-UNNAMED --version > NUL 2 >& 1
177+ set RESULT_CODE = %errorlevel%
178+ if NOT %RESULT_CODE% == 0 goto skipNativeAccessArg
179+ echo %OPENDJ_JAVA_ARGS% | findstr /C:" --enable-native-access=ALL-UNNAMED" > NUL 2 >& 1
180+ if %errorlevel% == 0 goto skipNativeAccessArg
181+ set OPENDJ_JAVA_ARGS = %OPENDJ_JAVA_ARGS% --enable-native-access=ALL-UNNAMED
182+ :skipNativeAccessArg
176183goto scriptBegin
177184
178185:setTempDir
Original file line number Diff line number Diff line change @@ -254,6 +254,17 @@ set_environment_vars() {
254254 then
255255 export OPENDJ_JAVA_ARGS=" $OPENDJ_JAVA_ARGS --add-exports java.base/sun.security.x509=ALL-UNNAMED --add-exports java.base/sun.security.tools.keytool=ALL-UNNAMED --add-opens java.base/jdk.internal.loader=ALL-UNNAMED"
256256 fi
257+
258+ " ${OPENDJ_JAVA_BIN} " --enable-native-access=ALL-UNNAMED --version > /dev/null 2>&1
259+ RESULT_CODE=${?}
260+ if test ${RESULT_CODE} -eq 0
261+ then
262+ case " ${OPENDJ_JAVA_ARGS} " in
263+ * " --enable-native-access=ALL-UNNAMED " * ) ;;
264+ * ) OPENDJ_JAVA_ARGS=" ${OPENDJ_JAVA_ARGS} --enable-native-access=ALL-UNNAMED" ;;
265+ esac
266+ export OPENDJ_JAVA_ARGS
267+ fi
257268}
258269
259270# Configure the appropriate CLASSPATH for server, using Opend DJ logger.
You can’t perform that action at this time.
0 commit comments