Eclipse Error:The selection cannot be launched, and there are no recent launches

I just installed eclipse and wanted to write a java program to test whether it could be used. As soon as I ran, I got an error, and debug was the same error. The error content was: the selection cannot be launched, and there are no recent launches, I couldn’t find this

Here’s the code

1 package test;
2 
3 public class test {
4 
5     static void main(String[] arg)
6     {
7         System.out.println("Hello World");
8     }
9 }

We found that we need to add a public before static, and the s of string must be uppercase, and main must be spelled correctly. The corrected code is as follows

package test;

public class test {

    public static void main(String[] arg)
    {
        System.out.println("Hello World");
    }
}

Found can run, successfully output results Hello world

Similar Posts: