Unable to run Java code with Intellij IDEA

后端 未结 12 2389
说谎
说谎 2020-12-14 05:18

I have just downloaded the IDE, and I want to edit my first Java file with it, I\'m not interested in creating a whole project, just editing the single file.

So I op

12条回答
  •  囚心锁ツ
    2020-12-14 05:58

    My classes contained a main() method yet I was unable to see the Run option. That option was enabled once I marked a folder containing my class files as a source folder:

    1. Right click the folder containing your source
    2. Select Mark Directory as → Test Source Root

    Some of the classes in my folder don't have a main() method, but I still see a Run option for those.

提交回复
热议问题