foreword
The version of JAVA is 11. When installing rocketmq, an error will be reported. Now this error is reported:
wyw@weiyuwang-ubuntu:~/Downloads/rocketmq-all-4.9.1-source-release/distribution$ sh bin/mqnamesrv
-Djava.ext.dirs=/jre/lib/ext:/home/ligang/Downloads/rocketmq-all-4.9.1-source-release/distribution/bin/../lib:/lib/ext is not supported. Use -classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
solution
vi bin/runserver.sh
# 注释掉下面这行
#export CLASSPATH=.:${BASE_DIR}/conf:${CLASSPATH}
# 修改成下面这行
export CLASSPATH=.:${BASE_DIR}/lib/*:${BASE_DIR}/conf:${CLASSPATH}
# 注释掉下面这行
JAVA_OPT="${JAVA_OPT} -Djava.ext.dirs=${JAVA_HOME}/jre/lib/ext:${BASE_DIR}/lib:${JAVA_HOME}/lib/ext"
references
https://www.cnblogs.com/freephp/p/14227065.html