RevolutionAnalytics / rhdfs

A package that allows R developers to use Hadoop HDFS
64 stars 73 forks source link

Unsupported major.minor version 51.0 with hdfs.init() #17

Open angerhang opened 9 years ago

angerhang commented 9 years ago

I know this has to do with the the difference between the Java versions during compile and runtime, however I think I have set all the environments variables properly so I don't really know that is still causing this issue.

$ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
$ javac -version
java 1.7.0_79
$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home
$ hadoop version
Hadoop 2.7.1
> Sys.getenv("JAVA_HOME")
[1] "/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home"
> library(rhdfs)
Loading required package: rJava

HADOOP_CMD=/usr/local/Cellar/hadoop/2.7.1/bin/hadoop

Be sure to run hdfs.init()
Warning message:
package ‘rJava’ was built under R version 3.1.3 
> hdfs.init()
Error in .jnew("org/apache/hadoop/conf/Configuration") : 
  java.lang.UnsupportedClassVersionError: org/apache/hadoop/conf/Configuration : Unsupported major.minor version 51.0

Also I set the $JAVA_HOME in Hadoop's hadoop-env.sh to 1.7.0 as well

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home

I would really appreciate if someone can point out what's going on here.

zhiboz commented 8 years ago

I ran into the same issue. Any help would be greatly appreciated!

angerhang commented 8 years ago

This is not a real solution but can work somehow.

I basically downgraded the hadoop version to 2.6.0 and used Java 1.6.0. First Check what version your Hadoop has, and then see if the version supports the Java version you are using.

andrewcheny commented 6 years ago

Same issue here except on different method

Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,  : 
  java.lang.UnsupportedClassVersionError: com/google/cloud/hadoop/fs/gcs/GoogleHadoopFileSystem : Unsupported major.minor version 52.0