The java.lang.UnsupportedClassVersionError problem that occurs when writing JUnit test

Source: Internet
Author: User

The following exception occurred today when writing some junit test for some project:

Java.lang.UnsupportedClassVersionError:moneytest/Moneytest (Unsupported Major.minor version49.0)
At Java.lang.ClassLoader.defineClass0 (Native Method)
At Java.lang.ClassLoader.defineClass (Classloader.java:539)
At Java.security.SecureClassLoader.defineClass (Secureclassloader.java:123)
At Java.net.URLClassLoader.defineClass (URLClassLoader.java:251)
At java.net.urlclassloader.access$100(URLClassLoader.java:55)
At java.net.urlclassloader$1. Run (URLClassLoader.java:194)
At java.security.AccessController.doPrivileged (Native Method)
At Java.net.URLClassLoader.findClass (URLClassLoader.java:187)
At Java.lang.ClassLoader.loadClass (Classloader.java:289)
At Sun.misc.launcher$appclassloader.loadclass (Launcher.java:274)
At Java.lang.ClassLoader.loadClass (Classloader.java:235)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass (Remotetestrunner.java:683)
At Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses (Remotetestrunner.java:425)
    at  Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (Remotetestrunner.java: 445)
    at  Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (Remotetestrunner.java: 673)
    at  Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (Remotetestrunner.java: 386)
    at  Org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (Remotetestrunner.java: 196)

At first I thought it was Project's problem (just beginning with Java write test), did not expect to write a simple Helloword test, also cannot run! Later found that the original is the JDK in Eclipse compliance Setup Error! Because my JRE is 1.4 and my JDK in eclipse is set to compliance 5.0, then of course there will be an error!!

Ext.: http://blog.csdn.net/yxuezhang/article/details/1341081

The java.lang.UnsupportedClassVersionError problem that occurs when writing JUnit test

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: info-contact@alibabacloud.com 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.