1

In alot of android examples they have me overriding function that don't seem to exist because the @override says it must override a superclass. This happens almost everytime in eclipse. I can normally just remove it and it appears to work.

here is an example from an OpenGl example

public class MultisampleConfigChooser implements GLSurfaceView.EGLConfigChooser {
static private final String kTag = "GDC11";
@Override
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {

it tells me chooseConfig needs to override a superClass can anybody tell me what im missing?

thanks

Edit: i don't think it is the JDK because there are other things overridden that are not giving errors. it is mainly just any opengl examples but its happened for like 4 different ones the first few just worked if i commented them out but some of them have like 20 overridden functions and im just trying to get it to run to see how it functions.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
RustyH
  • 473
  • 7
  • 22
  • May not be related: do you have the configuration correct? http://stackoverflow.com/questions/5926316/android-gles20-called-unimplemented-opengl-es-api – ta.speot.is Oct 06 '12 at 05:30
  • Older Java specs don't allow @Override for interface methods (only for inheritance). I'm not sure of the exact details, but perhaps you need to change which JDK you're using... – Rhys van der Waerden Oct 06 '12 at 05:36

1 Answers1

3

It has to do with you "compiler compliance level" setting. You probably have it set to 1.5 or lower. Set it to 1.6 to get rid of the errors.

Window | Preferences | Java | Compiler | JDK Compliance | Compiler Compliance Level
Sameer
  • 4,379
  • 1
  • 23
  • 23
  • hmm.. please check if you are setting it at project level. `Project | Properties | Java Compiler` – Sameer Oct 06 '12 at 05:57
  • very odd. it was at 1.5 and when i changed it to 1.6 it said i had to rebuild ok i rebuild and still have the errors along with this message in the console: Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tools > Fix Project Properties. – RustyH Oct 06 '12 at 06:03
  • 1
    Yeah Android does not like 1.7 . You should be able to work with 1.6 and not have those errors as well. Try clean build and stuff like that. – Sameer Oct 06 '12 at 06:06
  • well your right about 1.7 it does not like it did not realize that was what i changed it to. but 1.6 did not make the &override errors go away. so the problem persists – RustyH Oct 06 '12 at 06:19
  • Usually changing to 1.6 will solve the problem. If it doesn't, try to clean your project or restart eclipse -- it helps sometimes if your files are out of sync. – programmer33 Oct 06 '12 at 06:27
  • I tried this on a few more problem examples and it was the problem on a couple but for some reason 2 of the basic Opengl examples have the same problem still. so +1 for that – RustyH Oct 06 '12 at 07:10