首页 > 代码库 > Kafka中错误:Unrecognized VM option ‘UseCompressedOops’ Error: Clould not create the Java Vritual Machine. Error: A fatal exception has occurres . Program will exit.

Kafka中错误:Unrecognized VM option ‘UseCompressedOops’ Error: Clould not create the Java Vritual Machine. Error: A fatal exception has occurres . Program will exit.

  

  错误的描述:

  在kafka安装目录下,执行 $ bin/zookeeper-server-start.sh config/zookeeper.properties & 

 

Unrecognized VM option ‘UseCompressedOops’

Error: Clould not create the Java Vritual Machine.

Error: A fatal exception has occurres . Program will exit.

 

  解决方法:

找到bin/kafka-run-class.sh 文件,使用vim打开,我的这个版本是在115行

113 # JVM performance options

114 if [ -z "$KAFKA_JVM_PERFORMANCE_OPTS" ]; then

115   KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseCompressedOops -XX:+UseParNewGC     -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBeforeRe    mark -XX:+DisableExplicitGC -Djava.awt.headless=true"

116 fi

  去掉-XX:+UseCompressedOops这个设置

 

 技术分享

技术分享

技术分享

 

   去掉,之后的结果:

111 # JVM performance options

112 if [ -z "$KAFKA_JVM_PERFORMANCE_OPTS" ]; then

113   KAFKA_JVM_PERFORMANCE_OPTS="-server -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+CMSScavengeBefo    reRemark -XX:+DisableExplicitGC -Djava.awt.headless=true"

114 fi

 

  然后,保存,退出。再次,执行,

在kafka安装目录下,执行 $ bin/zookeeper-server-start.sh config/zookeeper.properties & 

技术分享

 

   即,此问题,得到了解决!

 

  参考链接: kafka入门介绍及环境搭建-Kafka-about云开发

Kafka中错误:Unrecognized VM option ‘UseCompressedOops’ Error: Clould not create the Java Vritual Machine. Error: A fatal exception has occurres . Program will exit.