Error when starting nacos after installation

Error report details

Insert image description here

which: no javac in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/install/redis6/bin:/root/bin)
readlink: 缺少操作数
Try ‘readlink --help’ for more information.
dirname: 缺少操作数
Try ‘dirname --help’ for more information.
ERROR: Please set the JAVA_HOME variable in your environment, We need java(x64)! jdk8 or later is better! !!

Reason for error

Java not found

Error reporting and resolution

which Java
Insert image description here
ll /usr/bin/java Insert image description here
ll /etc/alternatives/java
Insert image description here
Configure environment variables:
vi /etc/profile
add: at the end of the file:

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.362.b08-1.el7_9.x86_64/
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

source/etc/profile

Execute the nacos startup command again

Guess you like

Origin blog.csdn.net/qq_41943900/article/details/129662812