---
title: "'Must Override a Superclass Method' Errors after importing a project into Eclipse"  
description: "'Must Override a Superclass Method' Errors after importing a project into Eclipse"  
author: "Anonymous User"  
published: 2015-05-12  
updated: 2015-05-12  
canonical: https://www.mindstick.com/forum/23212/must-override-a-superclass-method-errors-after-importing-a-project-into-eclipse  
category: "android"  
tags: ["android", "java", "oops", "eclipse"]  
reading_time: 2 minutes  

---

# 'Must Override a Superclass Method' Errors after importing a project into Eclipse

Anytime I have to re-import my [projects](https://www.mindstick.com/articles/105927/how-to-excel-at-managing-multiple-projects) into Eclipse (if I reinstalled Eclipse, or changed the [location](https://www.mindstick.com/blog/11636/relocating-business-or-office-to-another-location) of the projects), almost all of my overridden [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best) are not formatted correctly, causing the error The method must override a superclass method.\
It may be noteworthy to mention this is with [Android](https://www.mindstick.com/articles/13046/10-reasons-why-i-prefer-android-vs-iphone-ios) projects - for whatever reason, the method argument values are not always populated, so I have to manually [populate](https://www.mindstick.com/blog/60/populate-records-in-second-listbox-according-to-the-selection-in-first-list-box) them myself. For [instance](https://www.mindstick.com/forum/155658/testing-connection-to-cloud-sql-instance-with-a-mysql-client-from-vm-instance):\

```
list.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {    //These arguments have their correct names    public void onCreateContextMenu(ContextMenu menu, View v,                                     ContextMenuInfo menuInfo) {                     }});
```

will be initially populated like this:\

```
list.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {    //This methods arguments were not automatically provided        public void onCreateContextMenu(ContextMenu arg1, View arg2,                                    ContextMenuInfo arg3) {    }});
```

The odd thing is, if I [remove](https://yourviews.mindstick.com/story/4554/8-harmful-weeds-to-remove-from-garden) my code, and have Eclipse automatically recreate the method, it uses the same argument names I [already](https://yourviews.mindstick.com/view/88453/the-hidden-ways-ai-is-already-controlling-your-daily-life) had, so I don't really know where the [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic) is, other then it auto-formatting the method for me.\
This becomes quite a pain having to manually recreate ALL my overridden methods by hand. If anyone can [explain](https://www.mindstick.com/forum/157854/what-is-system-debugging-explain-some-system-debugging-tools-used-in-modern-computer-systems) why this happens or how to fix it .. I would be very happy.\
Maybe it is due to the way I am formatting the methods, which are inside an argument of another method?

## Replies

### Reply by Anonymous User

Eclipse is defaulting to Java 1.5 and you have classes implementing interface methods (which in Java 1.6 can be annotated with @Override, but in Java 1.5 can only be applied to methods overriding a superclass method).

Go to your project/ide preferences and set the java compiler level to 1.6 and also make sure you select JRE 1.6 to execute your program from eclipse.


---

Original Source: https://www.mindstick.com/forum/23212/must-override-a-superclass-method-errors-after-importing-a-project-into-eclipse

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
