Why won’t the latest version of a Java Jar file run on my computer?

I recently received updated VPN software from a client.  I’d been using their previous GBAuth.jar quite happily for a number of years on my Mac but after installing the new version it just failed to work at all.  Double clicking on the GBAuth.Jar file to run it and the Mac would think about it for a moment and then do nothing.  Not a single error message, just nothing.  I keep my Mac up to date with all the latest patches so I knew I had the latest version of Java installed – or so I thought.  What I’d forgotten is that Apple only maintain Java version 6 if you want Java 7 or above you have to download it from Oracle.

Before I went to all the trouble of downloading and installing Java 7 from Oracle I wanted to check the version of Java used to build the old and new versions of the Jar file.  There are Jar file viewers but the easiest way for non-Java developers is simply to rename the jar file so it has a .zip extension, e.g. rename GBAuth.jar to GBAuth.zip.  You can then double click on it and have OSX expand the zip file. Within the root of this zip file you’ll find the Java Jar manifest.

Java Jar example manifest structure


You can right click on the  MANIFEST.MF file and open it with a text editor.

Java Jar Manifest created by Java 7


As you can see the new Jar file was actually created by Java 1.7.0-b18 so I couldn’t really expect it to work on my Java 6 installation on my Mac.  Just to prove this was the issue I looked at the old Jar file….

Java JAR created by Java 6


So this proved that the previous version of the Jar had been compiled with an earlier Java version.

I then downloaded and installed Java 7 for the Mac from the Oracle site and the Jar file worked perfectly.  In all of this I was only really surprised that double clicking a Jar file built under a previous version of Java just caused it to failed to run silently without any error message or assistance.  It’s not a great consumer experience.

You May Also Like…

Find similar blogs in these categories: Apple MacOS / OSX | Java
Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.