Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Post Timeline

Commonmark migration
Source Link

java.lang.UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime.

J2SE 8=52,
J2SE 7=51,
J2SE 6.0=50,
J2SE 5.0=49,
JDK 1.4=48,
JDK 1.3=47,
JDK 1.2=46,
JDK 1.1=45

First Rule: Java version must be same on your local pc and server. Otherwise this kind of unwanted problem may arise.

For more checking, You can check

java --version

javac --version

It will make clarify of jdk and jre version mismatch. If it shows various version, then uninstall other versions and build your project and deploy on server.

Another answer is similar to your problem is here: Cannot compile Java code - "class file has wrong version 52.0, should be 48.0"

Resource Link:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/crunchify/Main : Unsupported major.minor version 51.0

java.lang.UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime.

J2SE 8=52,
J2SE 7=51,
J2SE 6.0=50,
J2SE 5.0=49,
JDK 1.4=48,
JDK 1.3=47,
JDK 1.2=46,
JDK 1.1=45

First Rule: Java version must be same on your local pc and server. Otherwise this kind of unwanted problem may arise.

For more checking, You can check

java --version

javac --version

It will make clarify of jdk and jre version mismatch. If it shows various version, then uninstall other versions and build your project and deploy on server.

Another answer is similar to your problem is here: Cannot compile Java code - "class file has wrong version 52.0, should be 48.0"

Resource Link:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/crunchify/Main : Unsupported major.minor version 51.0

java.lang.UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime.

J2SE 8=52,
J2SE 7=51,
J2SE 6.0=50,
J2SE 5.0=49,
JDK 1.4=48,
JDK 1.3=47,
JDK 1.2=46,
JDK 1.1=45

First Rule: Java version must be same on your local pc and server. Otherwise this kind of unwanted problem may arise.

For more checking, You can check

java --version

javac --version

It will make clarify of jdk and jre version mismatch. If it shows various version, then uninstall other versions and build your project and deploy on server.

Another answer is similar to your problem is here: Cannot compile Java code - "class file has wrong version 52.0, should be 48.0"

Resource Link:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/crunchify/Main : Unsupported major.minor version 51.0

Source Link
SkyWalker
  • 29.3k
  • 14
  • 77
  • 134

java.lang.UnsupportedClassVersionError happens because of a higher JDK during compile time and lower JDK during runtime.

J2SE 8=52,
J2SE 7=51,
J2SE 6.0=50,
J2SE 5.0=49,
JDK 1.4=48,
JDK 1.3=47,
JDK 1.2=46,
JDK 1.1=45

First Rule: Java version must be same on your local pc and server. Otherwise this kind of unwanted problem may arise.

For more checking, You can check

java --version

javac --version

It will make clarify of jdk and jre version mismatch. If it shows various version, then uninstall other versions and build your project and deploy on server.

Another answer is similar to your problem is here: Cannot compile Java code - "class file has wrong version 52.0, should be 48.0"

Resource Link:

Exception in thread "main" java.lang.UnsupportedClassVersionError: com/crunchify/Main : Unsupported major.minor version 51.0

lang-java

AltStyle によって変換されたページ (->オリジナル) /