Error when trying to run Java Eclipse Project - java

Getting this error when trying to run JavaFX program. Does it have something do do with what version of Java i'm running on Eclipse? Current running jdk-11.0.2 and maybe running it on 1.8 would do the trick.
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: javafx/application/Application has been compiled by a more recent version of the Java Runtime (class file version 54.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 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)

As mentioned in official release notes of JDK 11
JavaFX is no longer included in the JDK. It is now available as a separate download from openjfx.io.
Yes, running on JDK1.8 would do the trick. But make sure to use Oracle JDK 1.8 and not OpenJDK 1.8. (You can get JavaFX to work on OpenJDK, but it'll be an extra hassle)

Related

JBoss eap 7.0.0 UnsupportedClassVersionError

I have some problems when deploying my app with JBoss eap 7.0.0
The app is compiled using Java 1.8 revision 121, and also the JBoss is launched with the same JDK.
The error is the following:
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/jboss/modules/Main : 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:442)
at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
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)
Does anybody have some information about what's happening? It seems like the error is in a module that is not from the application, but from any JBoss library (org/jboss/modules/Main)

unsupported class version error in spark submit

Trying to run spark application which I build using maven and jdk1.8 on a remote machine in which installed Java version: jdk 1.7.
Using spark-submit command:
./bin/spark-submit --class myapp.Main --master local[*] /home/mbala/myJars/CDCJar/myapp-0.0.1-SNAPSHOT.jar /home/mbala/myJars/CDCJar/previous.csv /home/mbala/myJars/CDCJar/source.csv /home/mbala/fer
Getting below exception:
Exception in thread "main" java.lang.UnsupportedClassVersionError: myapp/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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at org.apache.spark.util.Utils$.classForName(Utils.scala:225)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:686)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:185)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:210)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:124)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
If you build a Java program with a Java Development Kit 8, you need a Java Runtime of at least 8 to be able to run it, otherwise you get this exception. Upgrade the version of java on your remote machine or build with a JDK 7 instead to avoid such kind of issue.

java.lang.UnsupportedClassVersionError: com/ubikingenierie/jmeter/plugin/hls/result/HLSSampleResultConverter : Unsupported major.minor version 51.0

Running Apache JMeter 2.13 with Java 6 (1.6.0_65) and UbikLoadPack HLS plugin
I get this exception at startup:
2016/02/15 15:11:45 ERROR - jmeter.JMeter: Uncaught exception: java.lang.UnsupportedClassVersionError: com/ubikingenierie/jmeter/plugin/hls/result/HLSSampleResultConverter : 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 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:171)
at org.apache.jmeter.save.SaveService.registerConverter(SaveService.java:297)
at org.apache.jmeter.save.SaveService.initProps(SaveService.java:250)
at org.apache.jmeter.save.SaveService.<clinit>(SaveService.java:191)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:130)
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:102)
at org.apache.jmeter.gui.action.LoadRecentProject.doAction(LoadRecentProject.java:68)
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:81)
at org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:40)
at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:63)
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 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)
Not being able to run your own stuff might be very frustrating. It is due to Java version mismatch i.e. you're trying to run code compiled with higher version of Java on lesser version of runtime.
Remember to always use the latest version of JMeter and the latest version of Java (choose 64-bit Server JRE or JDK for your operating system).
You're also welcome to check out 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure guide for other recommendations on tweaking JMeter for maximum performance.
Plugin requires Java 7 to run even with Apache JMeter 2.13.
So ensure you use a Java 7 or Java 8.
Besides, if using Java 8, ensure you use a JMeter 2.12 or superior as JMeter is compatible with Java 8 only starting from this version.

Unsupported major.minor version 52.0 - grails

I just downloaded a grails project from svn.
I saw that the unsupported major.minor version is a well known problem on S.O. caused by a mismatch version of JDK used during runtime and compile time.
But I am using the very same version as below:
shell:
JAVA Build Path:
Installed JRE:
Please what am I missing for still having the below error?
Environment set to development
[groovyc] Compiling 190 source files to C:\Users\xxx
java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
at _GrailsCompile_groovy$_run_closure4_closure10.doCall(_GrailsCompile_groovy:117)
at _GrailsCompile_groovy$_run_closure4_closure10.doCall(_GrailsCompile_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsCompile_groovy$_run_closure4.doCall(_GrailsCompile_groovy:104)
at _GrailsCompile_groovy$_run_closure3.doCall(_GrailsCompile_groovy:69)
at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy:85)
at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:84)
at RunApp$_run_closure1.doCall(RunApp:28)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.UnsupportedClassVersionError: com/sun/tools/javac/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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.codehaus.groovy.tools.javac.JavacJavaCompiler.findJavac(JavacJavaCompiler.java:160)
at org.codehaus.groovy.tools.javac.JavacJavaCompiler.compile(JavacJavaCompiler.java:49)
at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit.gotoPhase(JavaAwareCompilationUnit.java:94)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:484)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:453)
at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:67)
at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:180)
at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:905)
at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:607)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
... 23 more
--- Nested Exception ---
java.lang.UnsupportedClassVersionError: com/sun/tools/javac/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 java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at org.codehaus.groovy.tools.javac.JavacJavaCompiler.findJavac(JavacJavaCompiler.java:160)
at org.codehaus.groovy.tools.javac.JavacJavaCompiler.compile(JavacJavaCompiler.java:49)
at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit.gotoPhase(JavaAwareCompilationUnit.java:94)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:484)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:453)
at org.codehaus.groovy.tools.FileSystemCompiler.compile(FileSystemCompiler.java:67)
at org.codehaus.groovy.tools.FileSystemCompiler.doCompilation(FileSystemCompiler.java:180)
at org.codehaus.groovy.ant.Groovyc.compile(Groovyc.java:905)
at org.codehaus.groovy.ant.Groovyc.execute(Groovyc.java:607)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at _GrailsCompile_groovy$_run_closure4_closure10.doCall(_GrailsCompile_groovy:117)
at _GrailsCompile_groovy$_run_closure4_closure10.doCall(_GrailsCompile_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsCompile_groovy$_run_closure4.doCall(_GrailsCompile_groovy:104)
at _GrailsCompile_groovy$_run_closure3.doCall(_GrailsCompile_groovy:69)
at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy:85)
at _GrailsPackage_groovy$_run_closure2_closure9.doCall(_GrailsPackage_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:280)
at _GrailsSettings_groovy$_run_closure10.call(_GrailsSettings_groovy)
at _GrailsPackage_groovy$_run_closure2.doCall(_GrailsPackage_groovy:84)
at RunApp$_run_closure1.doCall(RunApp:28)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Compilation error: java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main : Unsupported major.minor version 52.0
I run it via rightclick on project -> run-as -> grailsCommand (run-app)
The project was compiled using a newer version of JDK but is being run at an older version. Clean all your code and rebuild the project.
Sometimes this is due to a plugin whose binary has been compiled with a higher version of Java.
I fixed it by using the appropriate groovy version for grails version I have.
You can find the link here.
For instance, grails 2.3.9 -> groovy 2.1.9
I also made sure to use the right Java version based on grails.project.target.level in BuildConfig.groovy. For me, it is 1.7 (java 7)

neo4j basic hello-world code throws UnsupportedClassVersionError error in eclipse

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/neo4j/graphdb/RelationshipType : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
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 java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Now I know from here : How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version that neo4j might be needing a different version of JRE so compile time jre and runtime jre are a mismatch. I tried to change them through project specific settings but none of them worked. I am using 2.0.0 milestone release neo4j-community jars.
Let me know what other information I should provide.
Worked with updating to java-7-openjdk. Thanks #jon-skeet

Categories