File tree 2 files changed +16
-1
lines changed
xstream-jmh/src/application/bin
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%
44
44
for %%i in (lib\*.jar) do call :APP_CP_append %%i
45
45
call :APP_CP_append " config"
46
46
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
+
47
54
@ REM * Set options
48
55
@ REM *************
49
56
set JAVA_OPTS = %JAVA_OPTS% -Xmx2048m -Xss4m
50
57
51
-
52
58
@ REM * Main class
53
59
@ REM ************
54
60
set 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
41
41
APP_CP=$APP_CP :$i
42
42
done
43
43
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
+
44
53
# * Set options
45
54
# *************
46
55
JAVA_OPTS=" $JAVA_OPTS -Xmx2048m -Xss4m"
You can’t perform that action at this time.
0 commit comments