解决Zookeeper出现Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain问题
Error: Could not find or load main class org.apache.zookeeper.server.quorum.QuorumPeerMain
1. 安装maven
# 安装
wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
# 解压
tar -zxvf apache-maven-3.6.3-bin.tar.gz
# 添加环境变量
vim /etc/profile
export MAVEN_HOME=/usr/local/maven-3.6.3
export PATH=$PATH:$JAVA_HOME/bin:$MAVEN_HOME/bin
# 重新加载环境变量
source /etc/profile
# 查看是否安装成功
mvn -v
2. 重新编译zookeeper代码即可
cd /usr/local/zookeeper
cd /zookeeper-server
mvn package -Dmaven.test.skip=true
该花的钱要花,该吃的饭要吃。