zoukankan      html  css  js  c++  java
  • Eclipse出现错误:The selection cannot be launched,and there are no recent launches

    刚装了eclipse,想写个Java程序测试一下能不能用,结果一run就出现错误,Debug也是同样的错误,错误内容为:the selection cannot be launched,and there are no recent launches.由于是初学者,对于Java完全不懂,就上网搜索发现说右键项目选择run再选择run as application,发现找不到这个。

    以下是代码

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

    发现需要加一个public在static前,并且String的S必须为大写,并且main一定要拼写正确。改正后的代码如下

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

    发现可以运行,成功输出结果Hello World

    2018.09.18

  • 相关阅读:
    io学习三
    io学习二
    io学习一
    多线程学习(十五)
    spring源码阅读(四)
    多线程学习(十四)
    多线程学习(十三)
    设计模式(一)
    spring源码阅读(三)
    spring源码阅读(二)
  • 原文地址:https://www.cnblogs.com/do-hardworking/p/9669385.html
Copyright © 2011-2022 走看看