Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Java error message - Bad version number in .class file

I get the error noted below in Safari, Firefox, and Chrome when I try to view java containing web pages.


Specifically this page: http://aviationweather.gov/adds/tafs/java/


My Java Preferences are as follows


User uploaded file


My OS is 10.5.8


Thanks!


Java Plug-in 1.6.0_26

Using JRE version 1.5.0_30-b03-389-9M3425 Java HotSpot(TM) Client VM

User home directory = /Users/ernest

----------------------------------------------------

c: clear console window

f: finalize objects on finalization queue

g: garbage collect

h: display this help message

l: dump classloader list

m: print memory usage

o: trigger logging

q: hide console

r: reload policy configuration

s: dump system and deployment properties

t: dump thread list

v: dump thread stack

x: clear classloader cache

0-5: set trace level to <n>

----------------------------------------------------



java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:676)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)

at java.lang.reflect.Method.invoke(Method.java:592)

at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Plugin2ClassLoader.java :1014)

at sun.plugin2.applet.Plugin2ClassLoader.access$100(Plugin2ClassLoader.java:69)

at sun.plugin2.applet.Plugin2ClassLoader$2.run(Plugin2ClassLoader.java:991)

at java.security.AccessController.doPrivileged(Native Method)

at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Plugin2ClassLoader.java:9 55)

at sun.plugin2.applet.Applet2ClassLoader.findClass(Applet2ClassLoader.java:134)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Plugin2ClassLoader.java:250)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:180)

at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Plugin2ClassLoader.java:161)

at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Plugin2ClassLoader.java:675)

at sun.plugin2.applet.Plugin2Manager.createApplet(Plugin2Manager.java:3046)

at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Plugin2Manager.ja va:1498)

at java.lang.Thread.run(Thread.java:655)

Exception: java.lang.UnsupportedClassVersionError: Bad version number in .class file

Posted on Jul 18, 2012 12:31 PM

Reply
5 replies

Jul 18, 2012 7:43 PM in response to BDAqua

Hi, thank you for the reply. However, java is definitely enabled on my computer, on all my browsers. In fact, if I go to the SUN website and run the java test, I get that all is OK.


User uploaded file



I think it may have something to do with the .class (maybe in .jar-file) compiled with a higher version of java than the virtual machine trying to run it.

The example I found (google search) is .class-file that is compiled with JDK 6 and I am trying to run it with 1.4 JVM.



There is some software error going on somewhere... but I do not know enough to fix it.


Many thanks for all your help

Jul 18, 2012 7:52 PM in response to Homer-O's

I think I may know what the problem is:


Java Plug-in 1.6.0_26, which is newer than the VM trying to run it. (JRE version 1.5.0_30-b03-389-9M3425 Java HotSpot(TM) Client VM)


I think if I were able to upgrade the VM to 1.6 or newer, or downgrade the Plugin to 1.5, I would be OK


Not sure why Sun thinks all is OK when I go to the test website though

Java error message - Bad version number in .class file

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.