简体   繁体   English

我无法在intelliJ中运行该程序

[英]I can't run the program in intelliJ

在此处输入图片说明

I created a project unchecked (Create project form template) and added new class named demo. 我创建了一个未经检查的项目(创建项目表单模板),并添加了名为demo的新类。 but when after compiling, I couldn't run the code intellij didin't show me result. 但是在编译后,我无法运行intellij的代码,但没有显示结果。 "Edit configuration" only appeared like this: “编辑配置”仅显示如下:

在此处输入图片说明

I don't know what to do :( I saw someone run the code using Intellij without writing package. So I don't think that it doesn't work because I didn't write package. What can I do? 我不知道该怎么办:(我看到有人在不编写程序包的情况下使用Intellij运行代码。因此,我不认为这是因为我没有编写程序包而无法工作。

You are missing the String[] args parameter in your main method: 您在主要方法中缺少String [] args参数:

public static void main(String[] args) {

}

Add the args parameter to the main method. args参数添加到main方法中。 Then right click into the editor -> and select "Run demo.main()" 然后右键单击进入编辑器->并选择“运行demo.main()”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM