aspose file tools*
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
Author

running jar files in MAC

Jonk kulsh
Greenhorn

Joined: Feb 04, 2005
Posts: 7
hi

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(ClassLoader.java:502)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:250)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:272)
at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)

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.


42
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.

HTH

Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: running jar files in MAC