Eclipse 中是否有重新运行最近启动的程序的快捷方式?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1151995/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 18:50:39  来源:igfitidea点击:

Is there a shortcut in Eclipse to Re-run the most recently launched program?

eclipseide

提问by Itay Maman

One of the most frequent thing I do with Eclipse is to re-run the last program. I do it by going to Run -> Run History -> [top most item].

我用 Eclipse 做的最常见的事情之一就是重新运行最后一个程序。我通过转到Run -> Run History -> [top most item]来做到这一点。

Is there a shortcut key that does this?

有没有快捷键可以做到这一点?

I know of CTRL+ F11but this does not work for me. It will launch the most recent program only if the currently active class (the class whose source code I am editing) does not have a main method. If it does it will use this class as the entry point for the program and not the one from the Run History list.

我知道CTRL+F11但这对我不起作用。仅当当前活动的类(我正在编辑其源代码的类)没有 main 方法时,它才会启动最新的程序。如果这样做,它将使用此类作为程序的入口点,而不是运行历史记录列表中的入口点。

回答by VonC

For CTRL+F11to work the way you want, you must set (from "Windows/Preferences") the
"Run/debug > Launching : Launch Operation" setting to:

要使CTRL+F11以您想要的方式工作,您必须(从“Windows/首选项”)将
Run/debug > Launching : Launch Operation”设置设置为:

Always launch the previously launched application

始终启动之前启动的应用程序



As Thorbj?rn Ravn Andersenmentions in the comment, launching the last app used to be (3.2 or before) the default behavior.
Since 3.3M6(March 2007), As illustrated by this thread:

正如 Thorbj?rn Ravn Andersen在评论中提到的,启动最后一个应用程序曾经是(3.2 或之前)默认行为。
3.3M6(2007 年 3 月)以来,如该线程所示

By default, running and debugging applications has been simplified to run or debug the selected file or active editor.
When the selected resource (or active editor) is not executable, users can opt to launch the associated project or re-launch the previous launch.

These settings are managed on the Run/Debug > Launchingpreference page.
Users can also revert to the 3.2 behavior of always launching the previous application.

默认情况下,运行和调试应用程序已被简化为运行或调试所选文件或活动编辑器。
当所选资源(或活动编辑器)不可执行时,用户可以选择启动相关项目或重新启动之前的启动。

这些设置在Run/Debug > Launching首选项页面上进行管理。
用户还可以恢复到始终启动先前应用程序的 3.2 行为。



Torstenconfirms in the comments:

Torsten在评论中确认:

Pressing F11only launches the last application in debug mode.

F11仅在调试模式下启动最后一个应用程序。

回答by aeracode

Run -> Run History -> [top most item]is just Alt+ R+ T+ 1. But downside of this way is that Runmenu must contain only one item with 'T' hot-key.

运行 -> 运行历史记录 -> [最上面的项目]只是Alt+ R+ T+ 1。但这种方式的缺点是Run菜单必须只包含一个带有“T”热键的项目。

回答by Bombe

Yes, Ctrl-F11.

是的Ctrl- F11

回答by Eran Medan

For Scala projects (Scala IDE) I had to also add this to avoid selecting a Scala lanucher every time:

对于 Scala 项目(Scala IDE),我还必须添加它以避免每次都选择 Scala lanucher:

  • Run/Debug> Launching> Default Launchers preference
  • in Launch Type/Modeselect Scala Application
  • in Preferred Launcherselect Scala Application (new debugger) Launcher
  • 运行/调试>启动>默认启动器首选项
  • 启动类型/模式中选择Scala 应用程序
  • 首选启动器中选择Scala 应用程序(新调试器)启动器

This also works for other launches that open a dialog when you press Ctrl+F11

这也适用于按Ctrl+时打开对话框的其他启动F11

回答by Mutabor

Ctrl+Shift+F9stands for Relaunch with the same configuration.

Ctrl+ Shift+F9代表Relaunch with the same configuration.

This works out for me!

这对我有用!

At least in Pydev-Editor. I'm not sure about the other perspectives...

至少在 Pydev-Editor 中。我不确定其他观点......

回答by DragonBorn

Ctrl-F11

Ctrl-F11

And also you don't need to go to Run --> Run History. You can just click the small down arrow button next to the Run button (This looks like a green circle with a white play symbol in it) on your toolbar.

而且你不需要去运行 --> 运行历史记录。您只需单击工具栏上运行按钮旁边的小向下箭头按钮(这看起来像一个带有白色播放符号的绿色圆圈)。

回答by Sam Rajput

Yes, Ctrl + F11works in Windows and command + fn + F11in Mac.

是的,Ctrl + F11在 Windows 中有效,command + fn + F11在 Mac 中有效。

回答by ObviousChild

Ctl + F11 did not work for me either (Neon on Lubuntu). I started doing this: Alt + r + t + 1

Ctl + F11 对我也不起作用(Lubuntu 上的 Neon)。我开始这样做: Alt + r + t + 1

One could also use h instead of t to debug: Alt + r + h + #

也可以使用 h 而不是 t 来调试: Alt + r + h + #

I know it's a little longer but as long as I do not have to reach for the mouse and I can do it reliably on any Linux machine I am fine. Also, this way I can execute up to 9 previous runs by changing the number

我知道它有点长,但只要我不必伸手去拿鼠标,并且我可以在任何 Linux 机器上可靠地做到这一点,我就可以了。此外,这样我可以通过更改数字来执行多达 9 次之前​​的运行

回答by Imranmadbar

Way One:

方式一:

Click the project from of this icon at this time hold the shift Button, Project will restart (Terminate and relaunch) with server port also.

单击此图标的项目,此时按住 shift 按钮,项目将与服务器端口一起重新启动(终止并重新启动)。

enter image description here

在此处输入图片说明

Way Two:

方式二:

enter image description here:

在此处输入图片说明

From of Eclipse Menu Bar: Windows => Preferences => Type and select keys type filter tex: terminate and relaunch Bind your Shortcut Key Like this:

来自 Eclipse 菜单栏:Windows => Preferences => Type and select keys type filter tex: terminate and relaunch Bind your Shortcut Key 像这样: