解决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
 

 

posted @ 2020-07-20 20:56  老王同鞋  阅读(6314)  评论(1编辑  收藏  举报