Forums > Java

Unsupported major.minor version 51.0 ERROR when running MXJ quickie

March 1, 2012 | 5:33 pm

Hi,

I have been trying to run java externals using mxj quickie, but it never worked and I was getting this error message in the Max window:

Unsupported major.minor version 51.0

I read online it is a common error when: "you compiled your classes under a specific JDK, but then try to run them under older version of JDK. So, you can’t run classes compiled with JDK 6.0 under JDK 5.0. The same with classes compiled under JDK 7.0 when you try to run them under JDK 6.0."

My question is, how do I know which version of java is MAX using to run Java? If I knew, I could search for an earlier version to compile, since I am using the last one (downloaded it today). My version of MAX is 5.0.7.

Thank you!
Tsuki


March 4, 2012 | 12:13 pm

You haven’t specified whether you’re in OS X or Windows, but I can tell you how to do it inside Java itself:


System.getProperty("java.version");

You’d have to Google to match class file versions against Java versions/releases. I have some code for examining that somewhere.


November 10, 2012 | 5:11 am

Same problem here. Nothing I have tried works. I’m using the latest 1.7 release. I’ve tried editing max.java.config.txt to force java 1.7, ive changed the preferences in mxjpreferences.xml to point to the java jdk, etc etc…any help?

The classes in the max folder work, but compiling the simple "hello world" max tutorial program wont work


August 14, 2014 | 9:58 pm

I have the same problem here. Running Max 6.1.8, Installed Eclipse and have Java JDK 1.7 update 67.
I updated the Max file mxjpreferences.xml to point to the current jdk:

<map>
<entry key="BUILD_ROOT" value="/Applications/Max 6.1/Cycling ’74/java/classes"/>
<entry key="COMMAND" value="/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk/Contents/Home/bin/javac"/>
</map>

Double checked-through cut and paste that this is the correct path to javac. The error begins with:

java.lang.UnsupportedClassVersionError: gol : Unsupported major.minor version 51.0

The only idea I have is that the essential .jars I used to build the class file
(e.g., max.jar) are version 51.0 and do incompatible with Max 6.1.8


August 15, 2014 | 9:43 am

The problem is solved. My solution was to point Eclipse to Java SE 6 (version 1.6) which is
from Apple. The JVM should be in the /System directory on the Mac. All of the Oracle versions
(which can happily co-exist but not work with [mxj]) are stored under /Library. I wonder if the
root issue is where Apple’s Java was 32-bit and Oracle’s are all 64 bit? Oh, and run Max in
32bit mode (which it seems to be by default).

It would be nice to have [mxj] work with Oracle’s versions of Java to keep things up to date.
Currently, the latest development version is 1.8


Viewing 5 posts - 1 through 5 (of 5 total)