Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/fs/FsShell : Unsupported major.minor version 51.0 - hadoop

I am trying to execute below command on Hadoop
hadoop fs -ls /
but it is returing with the error
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/fs/FsShell : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.apache.hadoop.fs.FsShell. Program will exit.
I have tried updating the java but it is still giving me the same error.
Note: The same command is working on the other nodes but not on 2 for the cluster nodes.

Try updating the JDK to version 1.7. Perhaps, you have updated JRE not JDK.

If you used the CDH, you may need change the java version to jdk1.7.0_67-cloudera. After I changed the JAVA_HOME from /usr/java/jdk1.6.0_31 to /usr/java/jdk1.7.0_67-cloudera, I solved the problem.

Unsupported major.minor version 51.0
You need Java 7 (or higher) to run this.
See: https://www.java.com/de/download/faq/java_7.xml
If you already installed Java 7 (or higher) then execute it with:
C:\Program Files\Java\<Java Version (jre7/jre8>\bin\java.exe -jar <Path To .Jar>

The command is not working because it is pointing to the newer version of hadoop jars avilable on the nodes instead of the hadoop jars of installed version
It was pointing to jars placed in
/usr/lib/hadoop
Then i tried to execute it from the installation directory as below
/opt/cloudera/parcels/CDH/lib/hadoop/bin/hadoop fs -ls /
It worked for me.

Related

Plugin 'org.sonarlint.idea' failed to initialize and will be disabled. Please restart IntelliJ IDEA

I am getting the error above when I try to install the SonarLint plugin on my IntelliJ.
Mac OS X Yosemite 10.10.5
IntelliJ 15.06
SonarLint Plugin 2.2 (tried 2.1 also)
My JDK is set to 1.8 but not sure what is causing the issue. Any help will be appreciated.
Plugin 'org.sonarlint.idea' failed to initialize and will be disabled. Please restart IntelliJ IDEA.
com.intellij.diagnostic.PluginException: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : Unsupported major.minor version 51.0 [Plugin: org.sonarlint.idea]
at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:130)
at com.intellij.ide.plugins.cl.PluginClassLoader.a(PluginClassLoader.java:77)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:408)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:96)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:455)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:447)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:60)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:361)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.UnsupportedClassVersionError: org/sonarlint/intellij/config/global/SonarLintGlobalSettings : 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.lang.ClassLoader.defineClass(ClassLoader.java:471)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:260)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:256)
at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:225)
at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:124)
... 30 more
The following indicates that the JDK you are running with is not able to load classes compiled with JDK 7: Unsupported major.minor version 51.0
Check the JDK used by Intellij in the menu 'IntelliJ => About IntelliJ Idea'.
SonarLint for IntelliJ 2.2 requires JDK >= 7. Also note that upcoming new versions will probably require JDK >= 8.
To change the JVM that intellij Uses by default refer https://intellij-support.jetbrains.com/entries/23455956-Selecting-the-JDK-version-the-IDE-will-run-under.
You can Update /Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents/Info.plist
and replace JVMVersion 1.6* with 1.8*
JVMVersion
1.8*

robovm cannot initialise on windows 8.1

I have added a ANDROID_STUDIO_JDK system variable already.
Plugin 'org.robovm.intellij' failed to initialize and will be disabled. Please restart Android Studio.
com.intellij.diagnostic.PluginException: org/robovm/compiler/log/Logger : Unsupported major.minor version 52.0 [Plugin: org.robovm.intellij]
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:130)
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.java:77)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.robovm.idea.components.setupwizard.LicenseDialog.<init>(LicenseDialog.java:35)
at org.robovm.idea.components.RoboVmApplicationComponent.displaySetupWizard(RoboVmApplicationComponent.java:57)
at org.robovm.idea.components.RoboVmApplicationComponent.initComponent(RoboVmApplicationComponent.java:50)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:568)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610)
at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245)
at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:125)
at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:354)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:116)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87)
at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:499)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:481)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:170)
at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:52)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.lang.UnsupportedClassVersionError: org/robovm/compiler/log/Logger : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:259)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:255)
at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:231)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClassInsideSelf(PluginClassLoader.java:124)
... 34 more
I have encountered the same problem, but on Mac.
I have solved it by updating my Java from 1.7 to 1.8!
In this video, it says that before installing the RoboVM plugin, you should do some configurations, in particular choose Java 1.8 for JDK.
Also, here is the link to the same problem on RoboVM Google Group!

Error creating .war file

I am testing Tomcat7 showing data from the example table "malaga_plagues". I have done changes but, when I try test it again, I obtain the following error creating .war file.
[root#host-192-168-192-78 AMS_Widhoc]# ../../../apache-maven-3.3.3/bin/mvn package
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.defineClass(ClassLoader.java:643)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
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)
[root#host-192-168-192-78 AMS_Widhoc]#
One month ago this was working fine, but now I have resumed the example and it does not work. I reinstalled Orion CB in mi VM but I didn't change anything in Tomcat.
Could you help me? Thank you.
Maven 3.3.3 is only compatible with Java 7+, and it seems that you are trying to run it with Java 6. Please check your JAVA_HOME environment variable, it should point to a Java 7 JDK.

Exception in thread "main" while formatting namenode in hadoop

satya#ubuntu:~/hadoop/bin$ hadoop namenode -format
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/hadoop/hdfs/server/namenode/NameNode : 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)
Could not find the main class: org.apache.hadoop.hdfs.server.namenode.NameNode. Program will exit.
This error (Unsupported major.minor version) generally appears because of using a higher JDK during compile time and lower JDK during runtime. In this case 51 corresponds to JDK 7 (for more version mappings visit this link), this indicates that
whatever the JVM 1.6 runtime loaded, it was meant for JVM 1.7. Try using JDK 1.7 and set that using JAVA_HOME environment variable in hadoop-env.sh.
The default java version and you Hadoop's java version should match. Do this:
java -version
Open hadoop-env.sh (can be found in hadoop config folder) and search for JAVA_HOME. This java version and the default java version should match.
NOTE: Set your JAVA_HOME to point to jdk folder and not your java's bin folder
It is better if you can show your Hadoop version... but for Hadoop 2, I think you can try the new format command
[hdfs]$ $HADOOP_PREFIX/bin/hdfs namenode -format [-clusterid cid] [-force] [-nonInteractive]
So in your case, type
satya#ubuntu:~/hadoop/bin$ hdfs namenode -format
(I'm referring to Hadoop 2.7.0 which should apply to your situation.)
I also met the question. And when I type:
$hadoop classpath
I find the classpath of hdfs is wrong. Then I did
vi ~/.bashrc
export HADOOP_HDFS_HOME=$HADOOP_HOME
It works, hope it helps.

Hadoop 2.2.0 is compatible with Mahout 0.8?

I have hadoop cluster version 2.2.0 running with mahout 0.8, is it compatible? Because whenever I run this command:
bin/mahout recommenditembased --input mydata.dat --usersFile user.dat --numRecommendations 2 --output output/ --similarityClassname SIMILARITY_PEARSON_CORRELATION
Give me this error:
Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected
at org.apache.mahout.common.HadoopUtil.getCustomJobName(HadoopUtil.java:174)
at org.apache.mahout.common.AbstractJob.prepareJob(AbstractJob.java:614)
at org.apache.mahout.cf.taste.hadoop.preparation.PreparePreferenceMatrixJob.run(PreparePreferenceMatrixJob.java:75)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.mahout.cf.taste.hadoop.item.RecommenderJob.run(RecommenderJob.java:158)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
at org.apache.mahout.cf.taste.hadoop.item.RecommenderJob.main(RecommenderJob.java:312)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:72)
at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)
at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:152)
at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Or Im wrong? Any info would be helpful.
No, it does not work with Hadoop 2.x, someone else got the same error message like you.
It seems that at the very least it would require a recompile.
And more people are having the same problems: how can I compile/using mahout for hadoop 2.0?
About an hour ago Mahout has officially added support to Hadoop 2.x in the master branch (see MAHOUT-1329)
Checkout the code here https://github.com/apache/mahout and recompile using:
mvn clean package -Dhadoop2.version=2.2.0
Try and see if that works.
You can get the source code from github https://github.com/apache/mahout and run the following command
mvn -Dhadoop2.version=2.2.0 -DskipTests clean install
Then, you can find the release package in distribution/target/

Resources