Eclipse @override Error Resolution

Source: Internet
Author: User

Eclipse @override Error Resolution Keyword: Eclipse @override error Resolution

The first of these solutions:

@Override is JDK5 , but there is a small bug, is not support the implementation of the interface, that this is not an override
and JDK6 fixed this bug, whether the method of the parent class overrides or the implementation of the interface can be added @override

Modify your eclipse-specific compiler version
Specify a version at least 5.0 in the Java compiler option

The method of changing the compiler in MyEclipse: Project->properties->java compiler->configure Workspace Setting, can be set in the popup page.

This is from:http://blog.csdn.net/CodeJoker/archive/2009/07/02/4317361.aspx

Second Solution: (I use this method, no problem)

The use of @override in Java 1.5 and 1.6 is somewhat different, although the JRE has been changed, but eclipse will still make an error.

WORKAROUND: Windows->preferences-->java->compiler-->compiler compliance level is set to 1.6 OK.

Attention:

However, when importing a project, the Java.lang.UnsupportedClassVersionError:Bad version number in. class file exception is found after compiling and packaging to Tomcat. Checking my myeclipse, I found that the JDK version of my eclipse's compiler was inconsistent with the JDK version used by Tomcat, which was later set to match. It seems as if this problem has been caused.
The deployment of the project on Linux also appeared because of different versions of the problem, when we used the IDE compiler is JDK5.0, and that Linux installed is JDK6.0, after deployment found a lot of functions are wrong, it seems that some things still pay attention to AH.
Attached, the method of changing the compiler in MyEclipse: Project->proper ties->java compiler->configure Workspace Setting, can be set in the popup page

In fact, this kind of way is similar to the second one. The first way to focus is to set up this project. The second focus is on all of the items. But it can all be used.

Eclipse @override Error Resolution

Related Article

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.