Results 1 to 6 of 6
Thread: Help with error
- 05-07-2010, 08:08 PM #1
Member
- Join Date
- Apr 2009
- Posts
- 5
- Rep Power
- 0
Help with error
Hi everyone,
I'm getting this error, and I'm not sure how to fix it. I've deleted and built the file again, but I keep getting the same error.
Exception in thread "main" 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(Secure ClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader .java:260)
at java.net.URLClassLoader.access$100(URLClassLoader. java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 17)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:280)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:375)
Any help appreciated,
Ted
- 05-07-2010, 08:11 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Check the version of your compiler (javac -version) against the version of your jvm (java -version); they should match; also search for that class file, maybe an (old) copy is still stored somewere.
kind regards,
Jos
- 05-07-2010, 08:23 PM #3
Member
- Join Date
- Apr 2009
- Posts
- 5
- Rep Power
- 0
Hmm they match, I'm using eclipse, and things are a little messed up there because it has this Java version 1.6 that is unbound*
// java version "1.5.0_22"
// Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_22-b03-333-9M3125)
// Java HotSpot(TM) Client VM (build 1.5.0_22-147, mixed mode, sharing)
// javac 1.5.0_22
// javac: no source files
Is there a way to determine what version the class file has been compiled with.
Ted
- 05-07-2010, 08:30 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
- 05-07-2010, 08:45 PM #5
Member
- Join Date
- Apr 2009
- Posts
- 5
- Rep Power
- 0
aghh I tried that, it still doesn't work :(. The file has a lot of dependencies (other classes referenced) as well, so i'm also wondering if the problem is there, as they might be compiled on a different version, and eclipse doesn't seem to have a clean rebuild option.
Last edited by afflictedd2; 05-07-2010 at 08:49 PM.
- 05-08-2010, 08:15 AM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Eclipse has several options for that: you can start it from the shell (command line) with the -clean option, i.e. type "eclipse -clean"; alternatively you can go to Project>Clean ... and select the clean all projects option.
The last alternative is to select all projects in the package pane and press F5. Don't forget to set the compiler compliance to 1.5 for all your projects.
kind regards,
Jos
Similar Threads
-
> Operator cannot be applied error and return incompatible types error
By corney_16 in forum New To JavaReplies: 1Last Post: 03-10-2010, 01:53 PM -
Thread: Error 500--Internal Server Error java.lang.NullPointerException
By jackdear44 in forum New To JavaReplies: 1Last Post: 12-05-2009, 07:28 AM -
java.lang.Error: Error opening DSound for capture
By NARs in forum NetworkingReplies: 1Last Post: 10-26-2009, 04:38 PM -
Diference Between compiler error Garbage collection and Runtime Error?
By makpandian in forum New To JavaReplies: 3Last Post: 01-23-2009, 08:53 AM -
error 530 error authentication required
By rgale in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 05-12-2008, 04:28 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks