spark-shell command gives java error [duplicate] - java

This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 4 years ago.
I am new to spark. Trying to do setup in my local machine (mac), which has java version 1.7.0_80.
Followed these steps :
Downloaded apache spark, version spark-2.3.1-bin-hadoop2.6.tgz, from
https://spark.apache.org/downloads.html.
Untared the file, renamed the folder to spak and moved it to
/usr/local/spark
in /usr/local/spark, ran this command :bin/spark-shell
Got this java error :
Rajeev: spark rajeevnair$ bin/spark-shell
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/spark/launcher/Main : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

You need Java 8 to run Spark with a version greater than 2.2.0.
See the Spark documentatin for details:
Building Spark using Maven requires Maven 3.3.9 or newer and Java 8+. Note that support for Java 7 was removed as of Spark 2.2.0.
So your options are upgrading Java or using an older version of Spark.

Related

configure the oracle rest data service ORDS using JDK 7u-60? [duplicate]

This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Unsupported major.minor version 52.0 [duplicate]
(26 answers)
Closed 2 years ago.
I've tried to install and configure the oracle data rest service using JDK 7 and I got the error bellow:
C:\Program Files (x86)\Java\jdk1.7.0_80\bin>java -jar c:\conf\ords.war
Exception in thread "main" java.lang.UnsupportedClassVersionError: oracle/dbtool
s/jarcl/Entrypoint : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:14
2)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
If anyone has the answer please write it down in the comment and thanks in advance.
There's no configuring for Java 7.
You must use Java 8.
We're going to be moving up to minimum Java 11 in early 2021, although it should work now

Unsupported ClassVersion Error when deploying jira

I am trying to run jira application on my local machine with atlas-run and atlas-debug command. But i have a build failure here.
[ERROR] Failed to execute goal com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:6.2.1:run (default-cli) on project ccd_jirautils: Execution de
fault-cli of goal com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:6.2.1:run failed: Unable to load the mojo 'run' in the plugin 'com.atlassia
n.maven.plugins:maven-amps-dispatcher-plugin:6.2.1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupE
xception: com/atlassian/maven/plugins/ampsdispatcher/AmpsDispatcherRunMojo : Unsupported major.minor version 52.0
I tried to run the same on Linux machine i am able to get the success build with the jre 1.7 and atlassian_sdk version 5.0.3. when i am trying to run the same on Windows platform i get the above error. I also tried with jre 1.8 which is a bigtime failure jira refuse to start. so please I need your help here. can you please suggest me what might be the solution for this?
Caused by: java.lang.UnsupportedClassVersionError: com/atlassian/maven/plugins/ampsdispatcher/AmpsDispatcherRunMojo : Unsupported major.minor version
52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClassFromSelf(ClassRealm.java:389)
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
at org.eclipse.sisu.space.URLClassSpace.loadClass(URLClassSpace.java:107)
... 41 more
Following are the major versions of JRE the class file is compatible with
Java SE 9 = 53
Java SE 8 = 52
Java SE 7 = 51
Check what version of JAVA does your MAVEN is using mvn -version. You should be using jre 1.7
You didn't mention the Jira version you're running, but the error, as mentioned by ravthiru comes from a Java version mismatch. That is you have to use Java 8 for this to work, at least if you stick to the atlas-run and atlas-debug scripts, which use the mentioned com.atlassian.maven.plugins:maven-amps-dispatcher-plugin:6.2.1
which is a bit odd, as that one is included in the plugin-sdk 6.2.2, maybe you updated the sdk? Would you mind having a look inside atlas-run and double check it's 5.0.3?
That plugin was compiled using Java 8, so you either have to do so too or use an older version of the atlassian-plugin-sdk, which was compiled using Java 7. The 5.x versions should work.
Regarding the failure of running Jira with Java 8: Which version are you running, and what errors does it log?

running job in hadoop - ERROR

I'm trying to run a program in hadoop ~ $ Desktop/HadoopProject2016.jar input output and i keep getting this error :
Exception in thread "main" java.lang.UnsupportedClassVersionError:
hadoop_project_16/AggregateJob : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method) at
java.lang.ClassLoader.defineClass(ClassLoader.java:803) at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at
java.net.URLClassLoader.access$100(URLClassLoader.java:71) at
java.net.URLClassLoader$1.run(URLClassLoader.java:361) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:425) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
java.lang.ClassLoader.loadClass(ClassLoader.java:358) at
sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Also i dont know how to check the output... Is the error normal?
1) Check if your JRE (java version) of your project in your workspace(eg: eclipse properties window) is same as your java version in your machine from which you are running the hadoop jar command.
2) I am assuming that you are submitting the jar as
hadoop jar
Hadoop jars, you need to check them. Make sure all jars are updated (better bring in the latest version for every jar) and compatible with each other. You can find the version dependencies at http://www.mvnrepository.com/

Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) [duplicate]

This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 8 years ago.
running fedora 20 and using gedit as my editor.
when i compile my program and then try to run it using terminal, this happens:
Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
ABRT problem creation: 'success'
i have tried the simple google search but all i can find out is that the program is being compiled using a later version of java and being run with another. however, all the solutions i came across are based on eclipse and i am not using this.
please help!
The error that you are getting because you are using different version of Java. Try down grading to Java 1.7 or Java 1.6 if you are using Java 1.8.
Hope this helps.
It will help you. Its because, your compiler and JVM versions mismatch. Your IDE tools might have options to change Compiler version.
Unsupported major.minor version 52.0
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

Jar File is running in my computer but not Running in another computer [duplicate]

This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 8 years ago.
I created a jar file in my laptop and it runs fine in my computer without trouble but when i use the same in my friend's laptop it shows and exception and the file does not run. But it's still good with my laptop. What's the reason?
name of jar =BlueServer.jar
it has only one class.
classname=Server.java
one external library is used name=Bluecove.jar which is used for accessing bluetooth from java.
Ide used=Eclipse
used Eclipse for creating jar,already checked the option "Pacakage required libraries into generated jar"
This Error came while i try to run that same jar in another computer....
java -jar BlueServer.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: Server : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:56)
It is a problem with the version of the used JRE. See this post for details.
Try
java --version
on both machines.
This error indicates, that your file is not executable with the installed JRE version.
See How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version for more info about that.
java.lang.UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime. Make sure the jdk version installed in your laptop is equal or higher than your friend's.

Categories

Resources