Results 1 to 9 of 9
Thread: Unsupported class version.
- 10-02-2012, 03:27 PM #1
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
Unsupported class version.
I am using netbeans ide on mac, i do work on netbeans on a windows machine whilst doing lab work. I created some small programs and copied the project so i could take it home and work on it here. When i try to run the program i get this error message.
Now i have searched and found that it could be from using two different versions of jdk? I have updated to the latest version on my mac and netbeans is fully up to date as far as i can see. I have managed to run programs which i have created on this machine, but it wont run programs i created using the windows machine. I need to be able to be able to run the same programs on both, any ideas?Java Code:Exception in thread "main" java.lang.UnsupportedClassVersionError: EmptyFrameView : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at java.net.URLClassLoader.access$000(URLClassLoader.java:58) at java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) Java Result: 1
- 10-02-2012, 03:29 PM #2
Re: Unsupported class version.
What version of the JDK are you using to compile the code? What version of the JRE are you using to run it?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-02-2012, 03:36 PM #3
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
Re: Unsupported class version.
I have downloaded the jdk from here Oracle Java Development Kit 7u7 Downloads
I believe that is the latest version?
The jre is 1.7.0_07
- 10-02-2012, 03:52 PM #4
Re: Unsupported class version.
How are you compiling this? How are you running it? Try compiling and running via the command prompt to eliminate any IDE issues. What happens on each machine when you type "java -version" into the command prompt? What about "javac -version"?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-02-2012, 04:03 PM #5
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
Re: Unsupported class version.
I only have access to my machine at the moment "javac -version" returns "javac 1.6.0_35"
The program runs when using the terminal, as does the same code when copied into a new project which has been created on this computer.
- 10-02-2012, 04:09 PM #6
Re: Unsupported class version.
And what about "java -version" on that machine? My guess is that the compiler on the other machine is 1.7, whereas the JRE on this machine is 1.6 (the compiler can be different from the JRE, which is why I suggest testing both java and javac's versions). Try upgrading your JRE to 1.7 on this machine- that might include updating your path.
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
- 10-02-2012, 04:25 PM #7
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
- 10-02-2012, 04:27 PM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: Unsupported class version.
Please do not ask for code as refusal often offends.
- 10-02-2012, 04:58 PM #9
Senior Member
- Join Date
- Aug 2011
- Posts
- 116
- Rep Power
- 0
Re: Unsupported class version.
So basically the computer i originally used was using 1.7 but the one i am on now is running an earlier version. I have managed to navigate into the java preferences and moved 1.7 to the top so when i run "javac -version" i now get "1.7.0_07".
EDIT: All now working properly, thanks guys.Last edited by wdh321; 10-02-2012 at 05:13 PM.
Similar Threads
-
java.lang.UnsupportedClassVersionError: md/MD : Unsupported major.minor version 51.0
By Dissonance in forum Java AppletsReplies: 2Last Post: 06-25-2012, 08:01 PM -
Unsupported major.minor version 51.0
By j2me64 in forum Java AppletsReplies: 15Last Post: 04-15-2012, 10:35 AM -
Shall we skip Unsupported class version error?
By makpandian in forum New To JavaReplies: 1Last Post: 04-21-2011, 01:11 PM -
error cannot access class com.opensymphony.xwork2.ActionContext, wrong version
By gurpreet.singh in forum Advanced JavaReplies: 5Last Post: 03-31-2011, 12:17 PM -
Class Version in Serialization
By Gunas in forum New To JavaReplies: 5Last Post: 02-04-2010, 04:01 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks