Java学习笔记3---unable to launch

环境配置好后,在eclipse下编写HelloWorld程序:

①创建新工程

②创建.java文件,命名为HelloWorld

③在源文件中添加main方法,代码如下:

    public void main(String[] args){

        String.out.println(“HelloWorld!");

④点击运行按钮,弹出如下的信息:

The selection cannot be launched,and there are no recent launches.

⑤检查代码,发现main方法的类型漏写了static,添加后,如下:

public static void main(String[] args)

再点击运行,成功输出HelloWorld!

⑥查看工程目录,bin文件夹下生成了HelloWorld.class文件

posted @ 2017-09-21 10:35  蝉蝉  阅读(8217)  评论(0编辑  收藏  举报