Domanda

I have installed Java 8 on my machine and have started a project with it. However, when I use an @Override annotation, the code is underlined in red, and the error Syntax error, annotations are only available if source level is 1.5 or greater appears.

I have installed the released Eclipse Java Development Tools Patch with Java 8 support (for Kepler SR2), but this only adds support for new features in Java 8, and does not fix the bug with annotations.

È stato utile?

Soluzione

Make sure your INSTALLED_JRE is pointing to jdk 1.8 in eclipse

Preference > java > installed_jre

Make sure java > compiler is set to 1.8 in eclipse

preference > java > compiler > compiler compliance level 

Altri suggerimenti

If you are using maven, you can try right click the project name and run Maven/Update Project.

by default 1.4 version will set, so make sure set preference > java > compiler > compiler compliance level in eclipse IDE

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top