joekiller / jruby-kafka

Apache License 2.0
71 stars 52 forks source link

Unsupported major.minor version 51.0 #30

Closed jakubzak88 closed 8 years ago

jakubzak88 commented 9 years ago

jruby-kafka git:(master) ✗ gem install jruby-kafka -v '1.4.0' jar dependencies for jruby-kafka-1.4.0-java.gemspec . . . Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) 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 org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:401) at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:254) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) at org.codehaus.plexus.classworlds.launcher.Launcher.getMainClass(Launcher.java:144) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:266) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) ERROR: While executing gem ... (Errno::ENOENT) No such file or directory - /Users/jza01/.rvm/gems/jruby-1.7.19/gems/jruby-kafka-1.4.0-java/deps.lst

debaghtk commented 9 years ago

I too am facing this error :/

jakubzak88 commented 9 years ago

Execute this and send me print out:

/usr/libexec/java_home

debaghtk commented 9 years ago

/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

jakubzak88 commented 9 years ago

First of all you need to install latest jdk.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

Then set your env variable to:

export JAVA_HOME = "/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home"

Then when you run:

java -version

You should see something like this:

java version "1.8.0_51" Java(TM) SE Runtime Environment (build 1.8.0_51-b16) Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

If all this is set give it a go again and let me know if it helped.

jakubzak88 commented 9 years ago

Also I would recommend to take a look at these, also very helpful Kafka gems:

https://github.com/bpot/poseidon https://github.com/mthssdrbrg/heller

And for best support of all functionality I would personally go with JS node module:

https://github.com/SOHU-Co/kafka-node

Node module provided best error handling, speed and covers most of the Kafka features.

debaghtk commented 9 years ago

Hey thanks @Jukeboxino your solution is spot on :)

jakubzak88 commented 9 years ago

Happy to help ;)

joekiller commented 8 years ago

@Jukeboxino is spot on. Use java 8