The method must override the superclass method

I recently upgraded my computer to 64 bit Ubuntu 11.10. I have a problem importing my projects, it gives me an error

"The onView () method must override the superclass method."

I read in some other posts that the error must be using java 1.5, but Ubuntu 11.10 comes with open-6-jdk.

any solution ideas?


source to share

2 answers

It looks like your project's JDK compliance level is 1.5. (The Java version installed on the computer only determines how high you can set the compliance level.) You can check this in Eclipse by opening the project properties (right-click on the project name, then select Properties) and select Java Compiler "on the left.

In Java 1.6, annotation @Override

can (and should) be used for methods defined in implemented interfaces. Java 1.5 did not allow this.



You may have multiple Java virtual machines on your machine. Enter

$ ls /usr/lib/jvm


Do you see multiple entries there?

If yes, start Eclipse and go to Help-> About Eclipse Platform-> Configuration Details and look for the java.version property (for me it's 1.7.0_03-icedtea).

If it is not correct, you can go to Window-> Preferences-> Java-> Installed JREs, then you can change it to whatever you like.



All Articles