Bad version number in. Class File

Source: Internet
Author: User

To test the read operations on certificates in various formats, I wrote a very simple test class, but the following error occurs:
Java. Lang. unsupportedclassversionerror: bad version number in. Class File
At java. Lang. classloader. defineclass1 (native method)
At java. Lang. classloader. defineclass (unknown source)
At java. Security. secureclassloader. defineclass (unknown source)
At java.net. urlclassloader. defineclass (unknown source)
At java.net. urlclassloader. Access $100 (unknown source)
At java.net. urlclassloader $ 1.run( unknown source)
At java. Security. accesscontroller. doprivileged (native method)
At java.net. urlclassloader. findclass (unknown source)
At java. Lang. classloader. loadclass (unknown source)
At sun. Misc. launcher $ appclassloader. loadclass (unknown source)
At java. Lang. classloader. loadclass (unknown source)
At java. Lang. classloader. loadclassinternal (unknown source)

It was found thatThe versions of Java compile level and specified compiled JRE are inconsistent.;
For example, I specified version 1.5 in installed JRE and 6.0 in compile level. This type of problem usually occurs in some environments where 6.0 is required, while in some environments, 5.0 is required, when the environment is switched, the preceding two parameters are not modified together;
The solution is to set the two to the same and recompile them;

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.