Search code examples
eclipse

What could cause eclipse to display two "Source" menus for Java files?


In Eclipse 2023-06 and Eclipse 2023-09, the top menu displays two "Source" menus when I have a Java file opened. The first menu is what I would expect, and the second contains only one option "Format", which is also greyed-out.

This prevents me from using the shortcut alt + shift + s to open the Source menu.

First menu

Screenshot of the Eclipse top menus, with the two Source menus displayed. The first Source menu is opened, displaying all expected options, like "Toggle comment", "Add block comment", "Format", etc.

Second menu Screenshot of the Eclipse top menus, with the two Source menus displayed. The second Source menu is opened, displaying only the option, "Format", that is also disabled

The second "Source" menu disappears when I'm editing other files, like XML or properties files.

What could be causing this?

  • I tried resetting the key bindings, which didn't work.

  • Using right-click > open with... > Java editor doesn't work either.

  • Using right-click > open with... > Generic text editor made the first "Source" menu disappear, leaving only the second, that only contains the disabled "Format" option.


Solution

  • In this case, a plugin was adding the extra Source menu. The plugin was Spring Tools 4.

    Thanks @howlger for helping with the troubleshooting on my side.