Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why eclipse doesn't see implemented interfaces?

I've imported jfreechart-fse from here: https://github.com/jfree/jfreechart-fse and I've imported this to eclipse as maven project.

After that, I have many problems, for example in class ChartPanel in org.jfree.chart paskage, eclipse doesn't see "implements" section, and notice

@Override
    public void actionPerformed(ActionEvent event) {...}

as a problem. The same situation is in many other cases.

Can you tell what is wrong with that?

like image 227
Bernard Burn Avatar asked Jun 07 '13 12:06

Bernard Burn


2 Answers

Change version of java to 1.7. It resolves most of errors (errors still appear only in test directory in package-info.java files). Maven can build project successfully.

In eclipse you can change java version in project properties in Java Compiler tab or in properties of JRE System Library in your project tree.

like image 167
Mariusz Avatar answered Oct 06 '22 00:10

Mariusz


pom.xml doesn't declare java version for maven compiler plugin.

J2SE-1.5 is used by default, and Override anotation cannot be used for Interface implementation for this version.

Change Eclipse project configuration to use JavaSE-1.6, or fix pom.xml of project before importing:

<plugin>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.0</version>
  <configuration>
    <source>1.6</source>
    <target>1.6</target>
  </configuration>
</plugin>
like image 24
Toilal Avatar answered Oct 06 '22 01:10

Toilal