8

I've encountered a problem where on all of my applications, there's a red cross on the top right. I can run it, but the cross doesn't seem to go away.

I've opened the run/debug configurations and it says Warning : Main method not found. I don't understand why it's not found when I already have a corresponding main class and method for each and every application.

I tried to close the project, restarting IntelliJ, restarting my laptop, refreshing my desktop, refresh Gradle by clicking Reimport All Gradle Projects, rebuild the project and clicking Invalidate Caches / Restart. I also tried other suggestions I found on StackOverflow such as deleting the .idea folder. Nothing. The red cross still shows up. I've also realized that I do not have the out folder in all of my Applications.

edit run/debug configurations dialog

cannot resolve method 'run(java.lang.Class, String[])'

1
  • 3
    Judging from your screenshot, your JDK isn't properly configured. Commented Mar 16, 2021 at 6:41

4 Answers 4

7

File->Project structure ->SDKs

  • Choose JDK home path, if no jdk is in the path,
  • you'll see an icon download jdk
  • download then ok
Sign up to request clarification or add additional context in comments.

Comments

7

I just set the language level to equal my SDK version at Project Structure. Finally, it is disappeared.

enter image description here

Comments

4

In Project Settings, First make sure SDK path is correct. Preferably install and use your own SDK. Then use the same SDK in Project and Modules in Project Settings.

Comments

0

Try to copy src and gradle folders and buil.gradle and settings,gradle files in separate folder. Then open this new folder as new project in intellij. Then intellij will propose Import as gradle project... - push it. If problem remained see you build.gradle

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.