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

Posted 蝉蝉

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java学习笔记三---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文件

以上是关于Java学习笔记三---unable to launch的主要内容,如果未能解决你的问题,请参考以下文章