Error report details
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
ll /usr/bin/java
ll /etc/alternatives/java
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