Kafka启动自带的zookeeper时候 报 error: could not find class org.apache.zookeeper.server.quorum.quorumpeermain
Exception in thread "main" java.lang.NoSuchMethodError:
method java.lang.management.ManagementFactory.getPlatformMBeanServer
with signature ()Ljavax.management.MBeanServer; was not found.
at org.apache.zookeeper.jmx.ManagedUtil.registerLog4jMBeans(ManagedUtil.java:48)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:114)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:103)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:7
怎么办啊?我是liunx系统
应该是JDK版本的问题,或者是环境变量没有设置正确。
java - version 查看下当前版本。
确认jdk是否与你自身的系统匹配(32位和64位)
谢谢,是jdk的问题!
你好 可以告知是怎么解决的吗 我jdk 环境没有问题 运行java文件也没问题 我centos64位 也是用 64位的
C:\Tools\kafka-2.0.0-src\bin\windows>zookeeper-server-start.bat ./config/zookeeper.properties
错误: 找不到或无法加载主类 org.apache.zookeeper.server.quorum.QuorumPeerMain
C:\Tools\kafka-2.0.0-src\bin\windows>java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
你的答案