java Intellij 不显示运行按钮

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37081574/
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-11-03 02:10:48  来源:igfitidea点击:

Intellij doesn't show run button

javaintellij-ideamain-method

提问by Ugnius Malūkas

Intellij doesn't show run button even if that file is in srcfolder.

即使该文件在src文件夹中,Intellij 也不显示运行按钮。

no run button

没有运行按钮

Maybe do you know what to do?

也许你知道该怎么做?

P. s. It's strange because that file used to show run button but after recloning git repository it just doesn't show any more.

P.S. 这很奇怪,因为该文件曾经显示运行按钮,但在重新克隆 g​​it 存储库后,它不再显示。

回答by gevorg

Right click on srcdirectory and select option Mark Directory As> Sources Root.

右键单击src目录并选择选项Mark Directory As> Sources Root

回答by Zmiter

In my case Run/Debugbuttons disappeared for all projects after updating from IDEA 2019.2 to 2019.3. Tried checking Sources Root, Invalidate Caches, Run/Debug configurations etc - no luck. Only restoring Run/Debug action group helped:

在我的情况下,从 IDEA 2019.2 更新到 2019.3 后,所有项目的运行/调试按钮都消失了。尝试检查 Sources Root、Invalidate Caches、Run/Debug 配置等 - 没有运气。只有恢复运行/调试操作组有帮助:

Right click on main toolbar (where the button disappeared) > Customize Menus and Toolbars... > select Run/Debug > Restore Run/Debug.

右键单击主工具栏(按钮消失的地方)> 自定义菜单和工具栏... > 选择运行/调试 > 恢复运行/调试。

enter image description here

在此处输入图片说明