今天对于这个问题,我不得不来说下。
首先我百度了很多方法,没有解决。根据百度的方法,我检查了很多配置都没有问题。
这里我在说下,我使用的是idea 2019.3的版本。
一直提醒我,找不到主类。也不能确定。
代码如下:这个代码很简单,但是一直报上面的错误。
package com.xiaowh;
public class hello {
public static void main(){
System.out.print("hello");
}
}
下面我举例下,百度的各种说法:
他们所说的,我都有配置
这些都没有错!!!那么问题在哪里呢?
下面我来解释下。
最后我找了官方的文档
Main class
Specify the fully qualified name of the class to be executed (passed to the JRE). Type the class name manually or click the Browse button to open the Choose Main Class dialog, where you can find the desired class by name or search through the project.
翻译了下
说明下,谷歌翻译的,不是很准确,但是大概意思已经明白了,需要我们手动输入
253/5000
指定要执行的类的标准名称(传递给JRE)。 手动输入class名称或单击“浏览”按钮以打开“选择主要class”对话框,您可以在其中按名称查找所需class或在项目中进行搜索。
输入要运行的主类,先不管其他报错!!!
控制台,就会出现了
剩下,在根据提示修改。。