Ctrl + F11 is the "Run" keyboard shortcut in Eclipse.
But for me, that only works if a Main class is active in the editor. For any of the other 100+ java files in my workspace, eclipse pops up a dialog, complaining "Editor does not contain a main type".
This makes the Ctrl + F11 shortcut nearly useless. I either have to press Ctrl + Alt + T, name of main class, Ctrl + F11, or use the mouse.
Do I have something misconfigured? What can I do to make Ctrl + F11 really run my program, no matter which file is active in the editor? Or is everybody using the Ctrl + F11 shortcut like that?
edit: I'm using eclipse 3.5.0
My problem was solved when I restored defaults values of my Keys. Go to Window -> Preferences -> General -> Keys. Then, click Restore Defaults button at the bottom, and restart Eclipse.
Display and Edit the Current Keyboard Shortcuts To see the current key configuration and its keyboard shortcuts, choose the Eclipse > Preferences menu command to open the Eclipse workbench Preferences. Select the General > Editor > Keys page.
Shift+F11: Jump to the previous field in your document. Ctrl+F11: Lock a field so it cannot be edited. Ctrl+Shift+F11: Unlock a field.
Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.
Check the preferences, Launching section - you may want to switch from "launch selection" to "launch previously launched application".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With