JAR file does not open on Mac

I am trying to open a JAR file on my Mac without success. It says that the JAR file does not open and asks me to look for error messages in the console. Here are the console posts. I suspect the problem is on the first line, but I'm not from the software, so I donโ€™t know if this is enough for those who know Java to say what the problem is. I updated my software, so I assume I have the latest version of Java, although I donโ€™t know how to ensure 100% that - the website Java.com just told me to update the general software on my Mac and said that will take care of the latest version of Java. Please, help!

5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] Exception in thread "main" 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] java.lang.UnsupportedClassVersionError: Bad version number in .class file 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.lang.ClassLoader.defineClass1(Native Method) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.lang.ClassLoader.defineClass(ClassLoader.java:675) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.net.URLClassLoader.access$100(URLClassLoader.java:56) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.net.URLClassLoader$1.run(URLClassLoader.java:195) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.security.AccessController.doPrivileged(Native Method) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.net.URLClassLoader.findClass(URLClassLoader.java:188) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.lang.ClassLoader.loadClass(ClassLoader.java:316) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.lang.ClassLoader.loadClass(ClassLoader.java:251) 5/26/09 7:48:01 AM [0x0-0x72072].com.apple.JarLauncher[1079] at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374) 
+4
source share
5 answers

I assume JAR requires Java 6; most Mac computers only have Java 5 installed.

+8
source

The above exception occurs when the JVM encounters an unsupported version of the class. This happens when the JVM encounters a class built for the later JVM. So you need to upgrade your virtual machine and then change your default Java.

Here's how to change your default value:

Enter "java preferences" in the "Spotlight". You will see the Java Settings utility. Run this and you can change the default Java instance to what you need (probably Java 6).

EDIT: This utility is located in the / Utilities / Java application. Using Spotlight seems like an easier way to find it though!

+8
source

UnsupportedClassVersionError - there is your culprit. The class file was generated in a later version of the JDK than the JRE you are trying to run.

+3
source

Macs currently ships with Java 1.5. Java 1.6 can be downloaded for 64-bit Intel Macs here: http://support.apple.com/downloads/Java_for_Mac_OS_X_10_5_Update_1 . From http://support.apple.com/kb/HT1856 :

This release does not change the standard version of Java. This release is for Mac OS X 10.5.2 and later only and should not be installed on earlier versions of Mac OS X. This release is for Intel-based 64-bit computers only and cannot run on PowerPC or 32-bit Intel-based computers.

+1
source

Just right-click the .jar file and open the archive utility. Just. Location of the archive utility: /System/Library/CoreServices/Archive\ Utility.app

-1
source

All Articles