logstash启动报错could not find java

系统已经设置过java环境变量了,启动还是有这个提示:could not find java; set JAVA_HOME or ensure java is in PATH

export JAVA_HOME=/usr/local/java/jdk-11.0.9
export CLASSPATH=$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin

这时需要做个软链接,加上就可以正常启动了:

ln -s /usr/local/java/jdk-11.0.9/bin/java /usr/bin/java