【rocketmq】-rocketmq启动出错,“ERROR: Please set the JAVA_HOME variable in your environment, We need java”

系统环境:

ubuntun18.4

jdk:1.8

rocketmq:4.2.0

操作:

用命令“nohup sh mqnamesrv & ”启动nameserver或用“nohup sh mqbroker &”启动broker
问题:ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! !!
解决:在当前目录找到runserver.sh或runbroker.sh,用vim打开,定位到下面三行

[ ! -e “JAVA_HOME/bin/java" ] && JAVA_HOME= JAVA_HOME/bin/java" ] && JAVA_HOME= HOME/jdk/java
[ ! -e “JAVA_HOME/bin/java” ] && JAVA_HOME=/usr/java  
[ ! -e “
JAVA_HOME/bin/java” ] && JAVA_HOME=/usr/java  [ ! -e “
JAVA_HOME/bin/java” ] && error_exit “Please set the JAVA_HOME variable in your environment, We need java(x64)!”

将第 2,3行给屏蔽了,再次 启动nameserver或broker,就可以正常启动了
解决方案来源:https://blog.csdn.net/mingtian625/article/details/49307189

你可能感兴趣的:(java,rocketmq)