Skip to content

Commit

Permalink
Bug 61529 - Migration to Java 9
Browse files Browse the repository at this point in the history
Add Java 9 options to avoid the warnings that will disturb our users.
Warnings are due to:
- bulenkov/Darcula#41
- https://issues.apache.org/jira/browse/GROOVY-8339
Bugzilla Id: 61529

git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1822712 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pmouawad committed Jan 30, 2018
1 parent 042dac1 commit 03dc1b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions bin/jmeter
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ if [ -z "$JAVA_HOME" ]; then
fi

#--add-modules java.activation if JAVA 9
ADD_MODS=
JAVA9_OPTS=

# Minimal version to run JMeter
MINIMAL_VERSION=8
Expand All @@ -126,7 +126,7 @@ CURRENT_VERSION=`"${JAVA_HOME}/bin/java" -version 2>&1 | awk -F'"' '/version/ {g

# Check if Java is present and the minimal version requirement
if [ "$CURRENT_VERSION" -gt "$MINIMAL_VERSION" ]; then
ADD_MODS="--add-modules java.activation"
JAVA9_OPTS="--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
fi

: "${JMETER_OPTS:=""}"
Expand Down Expand Up @@ -184,7 +184,7 @@ SYSTEM_PROPS="-Djava.security.egd=file:/dev/urandom"
SERVER="-server"

if [ -z "${JMETER_COMPLETE_ARGS}" ]; then
ARGS="$ADD_MODS $SERVER $DUMP $JMETER_HEAP $VERBOSE_GC $JMETER_GC_ALGO $SYSTEM_PROPS $JMETER_LANGUAGE $RUN_IN_DOCKER"
ARGS="$JAVA9_OPTS $SERVER $DUMP $JMETER_HEAP $VERBOSE_GC $JMETER_GC_ALGO $SYSTEM_PROPS $JMETER_LANGUAGE $RUN_IN_DOCKER"
else
ARGS=""
fi
Expand Down
6 changes: 3 additions & 3 deletions bin/jmeter.bat
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ set MINIMAL_VERSION=1.8.0


rem --add-modules java.activation if JAVA 9
set ADD_MODS=
set JAVA9_OPTS=


for /f "tokens=3" %%g in ('java -version 2^>^&1 ^| findstr /i "version"') do (
Expand All @@ -103,7 +103,7 @@ IF "%JAVAVER:~1,2%"=="1." (
) else (
rem Java 9 at least
set current_minor=9
set ADD_MODS=--add-modules java.activation
set JAVA9_OPTS=--add-modules java.activation --add-opens java.desktop/sun.awt=ALL-UNNAMED --add-opens java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens java.desktop/sun.swing=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED
)


Expand Down Expand Up @@ -179,7 +179,7 @@ if not defined DDRAW (
rem Collect the settings defined above
set ARGS=%DUMP% %HEAP% %VERBOSE_GC% %GC_ALGO% %DDRAW% %SYSTEM_PROPS% %RUN_IN_DOCKER%

%JM_START% %JM_LAUNCH% %ADD_MODS% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%
%JM_START% %JM_LAUNCH% %JAVA9_OPTS% %ARGS% %JVM_ARGS% -jar "%JMETER_BIN%ApacheJMeter.jar" %JMETER_CMD_LINE_ARGS%

rem If the errorlevel is not zero, then display it and pause

Expand Down

0 comments on commit 03dc1b9

Please sign in to comment.