Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unsupported major minor version 51.0, but my JRE is up to date

Tags:

java

I built a Java application in Eclipse on Windows 7. I have Mac OSX 10.7.4 on a VMWare machine.

I built the app with JDK 1.7. I have JRE 1.7 on my Windows and the app works fine. I have Java 1.7 installed on the Mac VM Machine.

When launching the app on my Mac VM Machine, I get a "unspported major.minor version 51.0" error.

I know that this error means I don't have the right JRE to run my JAR file, but I do have JRE 7 installed (I installed it today).

My Application uses Apache FTP Client libraries but they are all included in the JAR file (I exported the Eclipse project into a Runnable JAR File, with all the required libraries).

like image 842
user2154283 Avatar asked Apr 14 '13 19:04

user2154283


People also ask

How do I fix Java Lang UnsupportedClassVersionError unsupported major minor version?

In order to overcome the UnsupportedClassVersionError, we can either compile our code for an earlier version of Java or run our code on a newer Java version.

How do I fix Java Lang UnsupportedClassVersionError error?

UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime. How can i make above change? Project -> Properties -> Java Compiler Enable project specific settings. Then select Compiler Compliance Level to 1.7, 1.6 or 1.5, build and test your app.

What is major version and minor version in Java?

A Java class file holds the Java bytecode for a Java class that can be executed on a Java virtual machine (VM). Encoded at the beginning of a class file is a major and minor version number of the class file format that is used in it. This major. minor number indicates which Java VM can execute this class file.


1 Answers

The solution to this issue can be found on this post : Installed Java 7 on Mac OS X but Terminal is still using version 6.

Thanks for everyone's help.

like image 172
user2154283 Avatar answered Oct 15 '22 00:10

user2154283