Unable to run Java code with Intellij IDEA

后端 未结 12 2489
说谎
说谎 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 06:01

    -First Move Your Code Files in side the "src" Folder

    -Make sure your Main method is declared like the following

       public class Main {
             public static void main(String []args){
    
    
           }
        }
    

    then:

    • Go to Project configurations
    • select Java application,
    • check allow parallel run
    • and select your main class

    and it should work

提交回复
热议问题