Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

running jar files in MAC

 
Jonk kulsh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a java --version on both machines and post the result
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic