Merge pull request #546 from jbonofre/AMQ-7087

[AMQ-7087] Add JDK 9+ specific JVM args to avoid warnings
This commit is contained in:
Jean-Baptiste Onofré 2020-06-23 08:52:26 +02:00 committed by GitHub
commit 0f92f2cabb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 131 additions and 22 deletions

View File

@ -323,12 +323,37 @@ invokeJar(){
echo "INFO: changing to user '$ACTIVEMQ_USER' to invoke java" echo "INFO: changing to user '$ACTIVEMQ_USER' to invoke java"
fi fi
# Get Java version
# Use in priority xpg4 awk or nawk on SunOS as standard awk is outdated
AWK=awk
if ${solaris}; then
if [ -x /usr/xpg4/bin/awk ]; then
AWK=/usr/xpg4/bin/awk
elif [ -x /usr/bin/nawk ]; then
AWK=/usr/bin/nawk
fi
fi
VERSION=`"${JAVACMD}" -version 2>&1 | ${AWK} -F '"' '/version/ {print $2}' | sed -e 's/_.*//g; s/^1\.//g; s/\..*//g; s/-.*//g;'`
# Execute java binary # Execute java binary
if [ -n "$TASK_TODO" ] && [ "$TASK_TODO" != "stop" ];then if [ -n "$TASK_TODO" ] && [ "$TASK_TODO" != "stop" ];then
if [ -z "$ACTIVEMQ_OUT" ]; then if [ -z "$ACTIVEMQ_OUT" ]; then
ACTIVEMQ_OUT="/dev/null" ACTIVEMQ_OUT="/dev/null"
fi fi
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \ if [ "${VERSION}" -gt "8" ]; then
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \
--add-reads=java.xml=java.logging \
--add-opens java.base/java.security=ALL-UNNAMED \
--add-opens java.base/java.net=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.util=ALL-UNNAMED \
--add-opens java.naming/javax.naming.spi=ALL-UNNAMED \
--add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED \
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED \
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED \
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \ -Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \ -Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ -Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
@ -339,30 +364,94 @@ invokeJar(){
RET=\"\$?\"; APID=\"\$!\"; RET=\"\$?\"; APID=\"\$!\";
echo \$APID > "${PIDFILE}"; echo \$APID > "${PIDFILE}";
echo \"INFO: pidfile created : '${PIDFILE}' (pid '\$APID')\";exit \$RET" $DOIT_POSTFIX echo \"INFO: pidfile created : '${PIDFILE}' (pid '\$APID')\";exit \$RET" $DOIT_POSTFIX
RET="$?" RET="$?"
else
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS >> $ACTIVEMQ_OUT 2>&1 &
RET=\"\$?\"; APID=\"\$!\";
echo \$APID > "${PIDFILE}";
echo \"INFO: pidfile created : '${PIDFILE}' (pid '\$APID')\";exit \$RET" $DOIT_POSTFIX
RET="$?"
fi
elif [ -n "$TASK_TODO" ] && [ "$TASK_TODO" = "stop" ];then elif [ -n "$TASK_TODO" ] && [ "$TASK_TODO" = "stop" ];then
SPID="`cat "${PIDFILE}"`" SPID="`cat "${PIDFILE}"`"
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \ if [ "${VERSION}" -gt "8" ]; then
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \ $EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \ --add-reads=java.xml=java.logging \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ --add-opens java.base/java.security=ALL-UNNAMED \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \ --add-opens java.base/java.net=ALL-UNNAMED \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \ --add-opens java.base/java.lang=ALL-UNNAMED \
$ACTIVEMQ_CYGWIN \ --add-opens java.base/java.util=ALL-UNNAMED \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS --pid $SPID & --add-opens java.naming/javax.naming.spi=ALL-UNNAMED \
RET=\"\$?\"; APID=\"\$!\"; --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED \
echo \$APID > "${PIDFILE}.stop"; exit \$RET" $DOIT_POSTFIX --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED \
RET="$?" --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED \
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED \
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED \
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS --pid $SPID &
RET=\"\$?\"; APID=\"\$!\";
echo \$APID > "${PIDFILE}.stop"; exit \$RET" $DOIT_POSTFIX
RET="$?"
else
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS --pid $SPID &
RET=\"\$?\"; APID=\"\$!\";
echo \$APID > "${PIDFILE}.stop"; exit \$RET" $DOIT_POSTFIX
RET="$?"
fi
else else
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \ if [ "${VERSION}" -gt "8" ]; then
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \ $EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \ --add-reads=java.xml=java.logging \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \ --add-opens java.base/java.security=ALL-UNNAMED \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \ --add-opens java.base/java.net=ALL-UNNAMED \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \ --add-opens java.base/java.lang=ALL-UNNAMED \
$ACTIVEMQ_CYGWIN \ --add-opens java.base/java.util=ALL-UNNAMED \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX --add-opens java.naming/javax.naming.spi=ALL-UNNAMED \
RET="$?" --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED \
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED \
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED \
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED \
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX
RET="$?"
else
$EXEC_OPTION $DOIT_PREFIX "\"$JAVACMD\" $ACTIVEMQ_OPTS $ACTIVEMQ_DEBUG_OPTS \
-Dactivemq.classpath=\"${ACTIVEMQ_CLASSPATH}\" \
-Dactivemq.home=\"${ACTIVEMQ_HOME}\" \
-Dactivemq.base=\"${ACTIVEMQ_BASE}\" \
-Dactivemq.conf=\"${ACTIVEMQ_CONF}\" \
-Dactivemq.data=\"${ACTIVEMQ_DATA}\" \
$ACTIVEMQ_CYGWIN \
-jar \"${ACTIVEMQ_HOME}/bin/activemq.jar\" $COMMANDLINE_ARGS" $DOIT_POSTFIX
RET="$?"
fi
fi fi
return $RET return $RET
} }

View File

@ -24,6 +24,10 @@ set.default.ACTIVEMQ_HOME=../..
set.default.ACTIVEMQ_BASE=../.. set.default.ACTIVEMQ_BASE=../..
set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf
set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data
# if you use JDK 9+, uncomment the following
#set.JDK_JAVA_OPTIONS=--add-reads=java.xml=java.logging --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED
wrapper.working.dir=. wrapper.working.dir=.
# Java Application # Java Application

View File

@ -24,6 +24,10 @@ set.default.ACTIVEMQ_HOME=../..
set.default.ACTIVEMQ_BASE=../.. set.default.ACTIVEMQ_BASE=../..
set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf
set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data
# if you use JDK 9+, uncomment the following
#set.JDK_JAVA_OPTIONS=--add-reads=java.xml=java.logging --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED
wrapper.working.dir=. wrapper.working.dir=.
# Java Application # Java Application

View File

@ -24,6 +24,10 @@ set.default.ACTIVEMQ_HOME=../..
set.default.ACTIVEMQ_BASE=../.. set.default.ACTIVEMQ_BASE=../..
set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf
set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data
# if you use JDK 9+, uncomment the following
#set.JDK_JAVA_OPTIONS=--add-reads=java.xml=java.logging --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED
wrapper.working.dir=. wrapper.working.dir=.
# Java Application # Java Application

View File

@ -24,6 +24,10 @@ set.default.ACTIVEMQ_HOME=../..
set.default.ACTIVEMQ_BASE=../.. set.default.ACTIVEMQ_BASE=../..
set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf
set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data
# if you use JDK 9+, uncomment the following
#set.JDK_JAVA_OPTIONS=--add-reads=java.xml=java.logging --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED
wrapper.working.dir=. wrapper.working.dir=.
# Java Application # Java Application

View File

@ -24,6 +24,10 @@ set.default.ACTIVEMQ_HOME=../..
set.default.ACTIVEMQ_BASE=../.. set.default.ACTIVEMQ_BASE=../..
set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf set.default.ACTIVEMQ_CONF=%ACTIVEMQ_BASE%/conf
set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data set.default.ACTIVEMQ_DATA=%ACTIVEMQ_BASE%/data
# if you use JDK 9+, uncomment the following
#set.JDK_JAVA_OPTIONS=--add-reads=java.xml=java.logging --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED
wrapper.working.dir=. wrapper.working.dir=.
# Java Application # Java Application