JS60
JS60

Reputation: 191

Major.minor unsupported version 51.0 Java MAC OSX

Ok if i try run a java file from console i get unsupported major.minor 51.0. These class files were't compiled on my MAC osx. BUT... If I'm in finder and right click the class file and open with jar launcher it loads. Im trying to load it with terminal, java programName. My java version in console says java version "1.6.0_65" Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609) Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

BUT in sys-pref-java it says Platform: 1.7 product: 1.7.0_51

Terminal using a different version? Not sure what to do.

Upvotes: 2

Views: 2720

Answers (2)

limc
limc

Reputation: 40160

Try this:-

export JAVA_HOME="$(/usr/libexec/java_home -v 1.7)"

Upvotes: 1

Matt
Matt

Reputation: 637

You should set your JAVA_HOME environment variable to the results of the /usr/libexec/java_home command (which evaluates to your system configured Java version).

Upvotes: 2

Related Questions