Use the "Java-jar" command to start a JDK version exception that is not supported by the jar pack times

Source: Internet
Author: User
Tags unsupported

When launching a jar package using the Java-jar command, the prompt version does not support:

1[Email protected] eureka-server-master]#  java-jar xuebusi-eureka-server-master.jar   2 Exception in thread "main" java.lang.UnsupportedClassVersionError: com/xuebusi/ Eurekaapplication:
Unsupported Major.minor version 52.0 3 At Java.lang.ClassLoader.defineClass1 (Native Method)4At Java.lang.ClassLoader.defineClass ( -)5At ( ($ -( in)8At$1. Run ($1. Run ( At (Native Method) OneAt ( AAt Java.lang.ClassLoader.loadClass ( -At Org.springframework.boot.loader.LaunchedURLClassLoader.loadClass ( -At Java.lang.ClassLoader.loadClass ( theAt ( $) -At Org.springframework.boot.loader.Launcher.launch ( the) -At Org.springframework.boot.loader.Launcher.launch ( -) -At Org.springframework.boot.loader.JarLauncher.main ( +[Email protected] eureka-server-master]#

This is because the JDK version is too low (I use MAVEN to hit the jar with the 1.8 version of the JDK, and I use Java-jar to run the jar package when the JDK installed on the server is version 1.7):

similar errors are in the Java version of the problem, that is, the JDK version is too low, just choose the corresponding JDK version compiled.  -, the, -,Wuyi, theis the version number inside the Java compiler: unsupported Major.minor version52.0Corresponds to JDK1.8(JRE1.8) Unsupported Major.minor version51.0Corresponds to JDK1.7(JRE1.7) Unsupported Major.minor version50.0Corresponds to JDK1.6(JRE1.6) Unsupported Major.minor version49.0Corresponds to JDK1.5(JRE1.5) Unsupported Major.minor version48.0Corresponds to JDK1.4(JRE1.4)

Resolution version: Unified JDK version, the JDK version of the jar package is consistent with the JDK version that is used to run the JDK.

Modify the JDK version in the Maven. pom.xml file to 1.7, and then re-hit the jar package.

Using the "Java-jar" command again to start the jar package, there is no longer a version issue.

If this article is helpful to you, please scan the QR code below to reward, your encouragement is my greatest encouragement!

Use the "Java-jar" command to start a JDK version exception that is not supported by the jar pack times

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.