运行按钮变灰 – IntelliJ

huangapple go评论85阅读模式
英文:

Run button is greyed out - intellij

问题

我在IntelliJ上正在进行一个项目,突然弹出一个窗口,现在运行按钮变灰。这是一个Java FX项目,可以使用覆盖和调试运行,但正常运行按钮变灰。可能的问题是什么?

附言:我知道提供的信息很有限,但不幸的是它之前可以运行,现在不能了,这就是全部。

英文:

I was working on a project in Intellij then suddenly there was a pop up and now the run button is greyed out. It is a Java FX project and it runs with coverage and debug, but the normal run button is greyed out. What could be the problem?

PS: I know I don't give you much to work with but unfortunately it was working and now it isn't, that's all.

答案1

得分: 40

我也遇到了同样的问题,通过使用旧的 "Invalidate Caches and Restart" 来解决它。

英文:

I had the same issue and fixed it with the old "Invalidate Caches and Restart"

答案2

得分: 20

打开源代码,右键单击,然后选择“运行”选项运行“filename.java”文件。

IntelliJ会为您创建配置,然后在IDE创建配置后,您可以点击运行按钮运行。

调试配置同样操作。

英文:

Open the source code, right-click and hit run using the option run "filename.java".

IntelliJ will make the configuration for you and then you can click the run button after the configuration is made by the IDE.

Same thing for debug configuration.

答案3

得分: 16

这种情况发生过无数次。一个可能的问题是程序仍在后台运行,并未完全退出。检查正在运行的进程中是否存在Java应用程序。

英文:

This has happened to me countless times. One possible problem is that the program is still running in the background and hasn't exited completely. Check your running processes for java applications and see if it exists.

答案4

得分: 3

尝试通过菜单栏中的<kbd>运行</kbd>再次启动程序。

英文:

Try to start the program again via <kbd>Run</kbd> in the menu bar.

答案5

得分: 3

重新启动 IntelliJ 并重新打开项目解决了我的问题。

英文:

Restarting IntelliJ and re-opening the project resolved the issue for me.

答案6

得分: 2

<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>F10</kbd>解决了我的问题。
我想对我来说,禁用Windows即时重播解决了这个问题。

英文:

<kbd>Alt</kbd>+<kbd>Shift</kbd>+<kbd>F10</kbd> solved my problem.
I guess for me disabling windows instant replay fixed the issue.

答案7

得分: 1

将JDK版本更改为11或任何LTS版本..

步骤:

  1. 文件> 项目结构
  2. 编辑SDK [在此处输入图片描述][1]

点击以下链接查看编辑SDK的图片:
[1]: https://i.stack.imgur.com/3IyXA.jpg

英文:

Change the jdk version to 11 or any lts ..

Steps :

  1. file> Project Structure
  2. Edit SDK [enter image description here][1]

Click on the below link to see the image for editing SDK :
[1]: https://i.stack.imgur.com/3IyXA.jpg

答案8

得分: 1

我在使用IDEA 2021.3.3终极版时遇到了完全相同的情况。我的“运行Hello(Shift+F10)”按钮变灰,所以我右键单击了源代码(编辑器中的任何空白处都可以),在菜单中有一个名为“运行Hello.main()(Ctrl+Shift+F10)”的选项,是可以点击的。我点击了它,然后它运行了,之后第一个按钮不再是灰色的。

英文:

I had the exact same thing using IDEA 2021.3.3 ultimate edition. My "Run Hello (Shift+F10)" button was greyed out, so I right clicked the source code (any whitespace in the editor worked fine), and there was an option in the menu called "Run Hello.main() (Ctrl+Shift+F10)", which WAS clickable. I clicked it, then it ran, after which the first button was no longer greyed out.

答案9

得分: 0

我认为是Maven/Gradle插件加载失败。

对我来说,我关闭了项目,打开了另一个之前的项目,然后运行按钮出现了。然后我关闭它,打开了我的新项目,我在右下角收到一个提示,上面写着“加载Maven脚本”,我点击了它,问题就解决了。

英文:

I think it the maven/gradle plugin that failed to load.

For me I closed the project, open another previous project and the run button appeared.Then I closed it and open my new project,I got a prompt bottom right that says "load maven script" I clicked it and it was resolved.

答案10

得分: 0

右键单击src/main目录 -> 标记目录为 -> 源代码根目录

这对我有用。

英文:

Right click the src/main directory -> Mark Directory as -> Sources Root

This fixed it for me.

答案11

得分: 0

我也遇到了与您一样的问题,当我刚刚安装了Intellij。在运行按钮附近有一个名为EDIT CONFIGURATIONS的按钮。我添加了配置(只是一些简单的设置)然后它就正常工作了。

在'Edit Configuration'下添加配置,然后应该就可以工作了。

英文:

I was also getting the same issue as I started with freshly installed Intellij. There's a button of EDIT CONFIGURATIONS near run button. I added the configurations (just a couple of things) and it worked.

Add configurations under &#39;Edit Configuration&#39; there and it should work.

huangapple
  • 本文由 发表于 2020年4月5日 04:29:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/61034359.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定