I created a custom jar for a map-reduce app and tried running it in Amazon EMR job flow. I compiled the code in hadoop 1.0.4, however Amazon EMR has support for Hadoop 1.0.3. Also I compiled the code under jdk 1.7, and I am not sure which version of java does Amazon EMR use and where can we change that ?
Here is the stacktrace
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/test/GWASMapReduce : 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 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.hadoop.util.RunJar.main(RunJar.java:180)
It appears that Java 7 isn't supported by Amazon EMR. You'll need to try compiling your jar to to target an older JVM:
javac -target 1.6 -cp .... etc
As per Muel Java 7 is not supported by Amazon EMR and as of today Amazon EMR supports version 1.0.3, 0.20.205.
Java 7 is still not supported on the EMR platform, see here
Its now supported since a while. Minimum is AMI version 2.4. See http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/ami-versions-supported.html
Related
in my school they asked me to make an application with JavaFXML, but I am having many problems with the IDE that I use, which is NetBeans Apache 12.2, because I have JDK 15 installed and it seems that since JDK 1.8 JavaFx does not come by default Anyway, I had to download JDK 1.7.8 so that it would allow me to make an application with JavaFX to do step by step as much as possible what my teacher does (If it were up to me, I would use any Java application and import the libraries) , but at the time of compiling the program it seems that it is compiling with JDK 15 or 1.8, I don't know, but the point is that I get an error for having compiled with a larger JDK. And I do not know how to configure NetBeans so that that does not happen, I hope you can guide me.
ant -f "C:\\Users\\home\\OneDrive\\Escritorio\\Laboratorio de ProgramaciĆ³n Orientada a Objetos\\JavaFXApplication2" jfxsa-run
jfxsa-run:
java.lang.UnsupportedClassVersionError: org/apache/tools/ant/launch/Launcher : 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)
Exception in thread "main"
Result: 1
BUILD SUCCESSFUL (total time: 1 second)
Version 52.0 means Java 1.8 and the error message means that you are compiling your java code with a Java 1.8 compiler but you are running it with a Java version that is less than 1.8. I guess, from your question, that you are running with 1.7.
I suggest that you remove all your JDK installations and simply install JDK 1.8. You can download it from here...
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
JDK 1.8 includes JavaFX.
If you prefer to use JDK 15, then you can download JavaFX 15 from here...
https://gluonhq.com/products/javafx/
The following link explains the java class file versions.
https://en.wikipedia.org/wiki/Java_class_file
I was trying to create a sample android application without using android-studio.While I tried to sign the package by $APKSIGNER sign --ks mykey.keystore bin/hello.unaligned.apk I got the following error.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has
been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the
Java Runtime only recognizes class file versions up to 52.0.
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495)
I am using openjdk 1.8.0_265 on fedora32. Does it have something to do with jdk ?
version 53.0 means using java version 9, and you current jre is version 8, which can not run java 9 codes.
so download and configure to use jre 9.
download link
This question already has answers here:
How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
(51 answers)
Closed 5 years ago.
I have a minecraft server running on a linux server i have at home, the server has been running fine in "snapshot 17w06a" for months without any issue. But now i want to update it to the "Minecraft 1.12-pre-release". I can easily set the server up locally on my PC, but when i try to run it on the server, it fails and gives the message below.
I have literally tried everything but it does not seem to work, i have even tried to copy the exact same folder that worked local on this PC onto the server. But it just won't start.
jens#clipster:~/Mc$ java -Xms1024M -Xmx2048M -jar minecraft_server.1.12.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/server/MinecraftServer : 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)
jens#clipster:~/Mc$
I would really appreciate any help i can get, than
If you look at Java docs of UnsupportedClassVersionError class it says:
Thrown when the Java Virtual Machine attempts to read a class
file and determines that the major and minor version numbers
in the file are not supported.
So JVM on your linux server doesn't support the version of JDK used to compile the new code. Version 52, implies your new code was compiler using JDK 1.8 and my guess is your Linux server runs any older Java version and hence this error.
I have Java 8 (JDK and JRE 8) on my machine. I have Eclipse Mars 4.5.1 .
I am trying to create a simple Static Web Project and while running the project on HTTP Preview (or a Dynamic Web Project on Apache Tomcat for that matter), it gives the following error. (Also see the screenshot attached.)
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/eclipse/jetty/server/Handler : 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 java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
The problem is that you're using JDK1.8 to compile your code (with target runtime of 1.8).
However, your server is configured to run with JDK 1.6 (you can see it at the top of the console window [ HTTP preview at...])
Change your workspace default JRE to your JDK 1.8 if you want to use the http preview (I tried and saw no option to specify a runtime JRE).
If you want to use tomcat, then specify the correct JRE on the first page of the 'New Server' wizard.
I had Developed Java Application in Windows 7.
And I had made JAR file of that application.
Now I want to convert that File into DMG format which is compatible for MAC Operating System.
Can any one Suggest me steps please?
I tried into terminal But got this errors.
DEVs-MacBook-Proist idev$ java -jar Soul_Spotter.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: idev/soulspotter/Login : 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 java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
The below link explains the steps. I've also copied the answer which worked for me.
Copied from convert java app to mac installer...dmg
Use "Jar Bundler" in the XCode download from Apple Developer
Connection.
http://developer.apple.com/technology/xcode.html
You will need to register for a free account.
Steps: http://www.centerkey.com/mac/java/