Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse: How can I make Ctrl+F11 work no matter which file is being edited?

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

like image 532
amarillion Avatar asked Feb 06 '10 12:02

amarillion


People also ask

Why shortcuts are not working in Eclipse?

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.

How do I enable shortcut Keys in 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.

What does Ctrl Shift F11 do?

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.

What is Ctrl Shift G in Eclipse?

Search – Eclipse Shortcuts CTRL SHIFT G – Search for current cursor positioned word reference in workspace. CTRL H – Java search in workspace.


1 Answers

Check the preferences, Launching section - you may want to switch from "launch selection" to "launch previously launched application".

like image 151
vwegert Avatar answered Oct 20 '22 10:10

vwegert