简体   繁体   中英

Shortcut for “build and run” in Eclipse for Mac (OSX)

I'm looking for a shortcut that will allow me to build and run a project in Java that is currently opened.

There is a shortcut like this: + + x and then j but it only works if there is a public static void main() method delacred in the currently viewed file.

Is there a shortcut that can be used no matter which file of the project you want to run is currently opened?

That key combination will work for the whole project only if the focus/selection is on a project in Package Explorer or Project Explorer.

Alternatively, you can re-launch the last program (or test), regardless of where your focus is, using the Run Last Launched command:

Windows: Ctrl + F11 .

Mac: + + F11 or + + fn + F11 (depending on your settings of the function keys).

That's a reasonable alternative if you find yourself repeatedly running the same program or test.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM