kafka建立topic異常

問題描述:

   kafak運行在weblogic帳戶下,jdk1.8,當在root帳戶下建立topic(當前帳戶下的jdk1.6)致使建立topic失敗java

./bin/kafka-topics.sh --create --zookeeper x.x.x.x:2181 --replication-factor 1 --partitions 8 --topic ngx
Exception in thread "main" java.lang.UnsupportedClassVersionError: joptsimple/OptionSpec : Unsupported major.minor version 51.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at kafka.admin.TopicCommand.main(TopicCommand.scala)

問題解決:

Unsupported major.minor version 51.0  //運行在jdk1.7+,檢查執行用戶的jdk版本  java -version     //查看當前帳戶下jdk版本
相關文章
相關標籤/搜索