File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
xstream-jmh/src/application/bin Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,17 @@ set JAVA_BIN=%JAVA_EXE%
4444for %%i in (lib\*.jar) do call :APP_CP_append %%i
4545call :APP_CP_append " config"
4646
47+ @ REM * Open modules for parsers using Java 17 or higher
48+ @ REM *************
49+ for /F " tokens=2 usebackq" %%j in (`%JAVA_BIN% -cp " %APP_CP% " com.thoughtworks.xstream.core.JVM ^ | find " java.specification.version" `) DO SET JAVA_VERSION = %%j
50+ if %JAVA_VERSION% GEQ 17 set JAVA_OPTS = %JAVA_OPTS% --add-opens java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED
51+ if %JAVA_VERSION% GEQ 17 set JAVA_OPTS = %JAVA_OPTS% --add-opens java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED
52+ if %JAVA_VERSION% GEQ 17 set JAVA_OPTS = %JAVA_OPTS% --add-opens java.xml/com.sun.xml.internal.stream=ALL-UNNAMED
53+
4754@ REM * Set options
4855@ REM *************
4956set JAVA_OPTS = %JAVA_OPTS% -Xmx2048m -Xss4m
5057
51-
5258@ REM * Main class
5359@ REM ************
5460set MAIN_CLASS = org.openjdk.jmh.Main
Original file line number Diff line number Diff line change @@ -41,6 +41,15 @@ for i in lib/*.jar; do
4141 APP_CP=$APP_CP :$i
4242done
4343
44+ # * Open modules for parsers using Java 17 or higher
45+ # *************
46+ JAVA_VERSION=` $JAVA_BIN -cp $APP_CP com.thoughtworks.xstream.core.JVM | grep " java.specification.version" | cut -d ' ' -f 2`
47+ if [[ $JAVA_VERSION -ge 17 ]]; then
48+ JAVA_OPTS=" $JAVA_OPTS --add-opens java.xml/com.sun.org.apache.xerces.internal.parsers=ALL-UNNAMED"
49+ JAVA_OPTS=" $JAVA_OPTS --add-opens java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED"
50+ JAVA_OPTS=" $JAVA_OPTS --add-opens java.xml/com.sun.xml.internal.stream=ALL-UNNAMED"
51+ fi
52+
4453# * Set options
4554# *************
4655JAVA_OPTS=" $JAVA_OPTS -Xmx2048m -Xss4m"
You can’t perform that action at this time.
0 commit comments