This is an automated email from the ASF dual-hosted git repository.

technoboy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new e0bdfbceb92 [fix][cli] pulsar-perf fails on jdk17 (#18806)
e0bdfbceb92 is described below

commit e0bdfbceb92217448bcaca0a02adb6a894966626
Author: Nicolò Boschi <[email protected]>
AuthorDate: Thu Dec 8 09:32:53 2022 +0100

    [fix][cli] pulsar-perf fails on jdk17 (#18806)
---
 bin/pulsar-perf | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/bin/pulsar-perf b/bin/pulsar-perf
index ad22d5be39f..47c02bc3d67 100755
--- a/bin/pulsar-perf
+++ b/bin/pulsar-perf
@@ -134,6 +134,13 @@ 
PULSAR_CLASSPATH="$PULSAR_JAR:$PULSAR_CLASSPATH:$PULSAR_EXTRA_CLASSPATH"
 PULSAR_CLASSPATH="`dirname $PULSAR_LOG_CONF`:$PULSAR_CLASSPATH"
 OPTS="$OPTS -Dlog4j.configurationFile=`basename $PULSAR_LOG_CONF` 
-Djava.net.preferIPv4Stack=true"
 
+IS_JAVA_8=`$JAVA -version 2>&1 |grep version|grep '"1\.8'`
+# Start --add-opens options
+# '--add-opens' option is not supported in jdk8
+if [[ -z "$IS_JAVA_8" ]]; then
+  OPTS="$OPTS --add-opens java.base/sun.net=ALL-UNNAMED --add-opens 
java.base/java.lang=ALL-UNNAMED"
+fi
+
 OPTS="-cp $PULSAR_CLASSPATH $OPTS"
 OPTS="$OPTS $PULSAR_EXTRA_OPTS"
 

Reply via email to