Java - Unsupported major.minor version 52.0

  • Java
  • Thread starter hzp
  • Start date
  • Tags
    java
In summary, the conversation is about a programmer trying to create an executable file for a Java window application. They initially used notepad++ and command line to compile the program, but encountered an error when trying to run the executable file. They then downloaded jsmooth and followed instructions to change the minimum JVM version, which resolved the issue.
  • #1
hzp
10
0
I am programming in Java, creating a window application. I used notepad++ and compile through the command line. The program compiles and runs fine through the command line

However I want to create an executable file, so I downloaded jsmooth

But it is giving me this error and I can't really find any information that helps me:
"Exception in thread main java.lang.UnsupportedClassVersionError: Game : Unsupported major.minor version 52.0"

This is after the executable has been compiled and I try to run it. It starts and the debug command opens with this error

Followed instructions on jsmooth website and here:
http://www.coolwebproject.com/jsmooth/

my code below, not sure how it would be relevant
 

Attachments

  • zip.zip
    1.2 KB · Views: 326
Last edited by a moderator:
Technology news on Phys.org
  • #2
Nevermind - problem is all sorted. Had to change minimum JVM version to the source version
 
  • #3
Hi,

How exactly did you change the minimum JVM version?
I'm facing the same problem, however I don't know what you mean by "change minimum JVM version".
How exactly do I do that?

Thank you, if you reply this would be a major help for me!
 
  • #4
It means that he compiled the code with one version of Java and tried to run the compiled code with a lower version. This often happens when you are using an IDE to compile and the version that it is set up to use is not the same as the JVM being used by your computer.
 

1. What does "java.lang.UnsupportedClassVersionError: Unsupported major.minor version 52.0" mean?

This error means that the version of Java used to compile the code is not compatible with the version of Java used to run the code.

2. How can I resolve the "java.lang.UnsupportedClassVersionError" error?

To resolve this error, make sure that the version of Java used to compile the code is the same as the version used to run the code. If necessary, update your Java installation to the latest version.

3. What is the significance of the major.minor version number in this error?

The major.minor version number refers to the Java class file format version. Each version of Java introduces new features and changes to the class file format, and a compatibility check is performed when running code to ensure that the correct version is used.

4. How can I check the version of Java used to compile my code?

You can use the "javap" command in the command line to view the version of Java used to compile a specific class file. Alternatively, you can check the "source" and "target" attributes in the "javac" command used to compile the code.

5. Can this error occur if I use a newer version of Java to run code compiled with an older version?

No, this error only occurs when using an older version of Java to run code compiled with a newer version. Java is backwards compatible, so using a newer version to run older code should not cause any issues.

Similar threads

  • Programming and Computer Science
Replies
2
Views
844
  • Programming and Computer Science
Replies
3
Views
4K
  • Programming and Computer Science
Replies
5
Views
1K
  • Programming and Computer Science
Replies
5
Views
1K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
12
Views
9K
  • Programming and Computer Science
Replies
1
Views
268
  • Programming and Computer Science
Replies
1
Views
3K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
Replies
29
Views
2K
Back
Top