Run button is greyed out - intellij

Viewed 41051

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.

9 Answers

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

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.

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.

Try to start the program again via Run in the menu bar.

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

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.

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

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

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.

Related