File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes running jar files in MAC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "running jar files in MAC" Watch "running jar files in MAC" New topic

running jar files in MAC

Jonk kulsh

Joined: Feb 04, 2005
Posts: 7

i hv made a jar file in window which is running quit well in windows but when i tried to run this file in MAC OS i'm getting following errors:

Exception in thread "main" java.lang.UnsupportedClassVersionError: ProgressBarExample (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(
at Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(

plz help me
Daniel Rhoades
Ranch Hand

Joined: Jun 30, 2004
Posts: 186
Do a java --version on both machines and post the result

Drinking more tea is the key...
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
There is as yet no 1.5/5.0 runtime for Mac OS/X (or any other Mac OS.
Your classes were compiled on a 1.5 compiler without using the -target1.4 flag and therefore are in classfile format 49 instead of 48 (48 is the version produced by 1.4) and will not work on 1.4 JVMs.

Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
As Jeroen implies, but doesn't state very clearly, the solution to your problem is to generate .class files that can be run on JRE 1.4. You do this by using the "-target 1.4" command-line option. If you need help with what this means exactly, feel free to come back and ask. We will need to know what environment you use to write and compile your Java program. If you are using a text editor (like NotePad or something else) and the command-line, it shouldn't be too difficult. If you are using an IDE, please tell us which one and the version number. Hopefully someone will be able to tell you how to set the command-line options.



Java API Documentation
The Java Tutorial
I agree. Here's the link:
subject: running jar files in MAC
It's not a secret anymore!