Eclipse 错误:找不到或无法加载主类 [英] Eclipse Error: Could not find or load main class

查看:53
本文介绍了Eclipse 错误:找不到或无法加载主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已针对此错误在 Google 上进行了广泛搜索,但我似乎无法解决该问题.我已经在Eclipse Juno中编写了一个基本的java程序,如下:

Have Googled extensively on this error, but I can't seem to fix the problem. I've written a basic java program in Eclipse Juno, as follows:

public class HelloWorld {

    /**
     * @param args
     */

    public static void main(String[] args) {
        System.out.println("Hello Eclipse!");
    }

}

单击运行后,我收到:错误:无法找到或加载主类 HelloWorld".此错误消息适用于我在同一工作区中的所有其他项目.我试过切换工作区,但错误仍然出现.

After clicking Run, I get: "Error: Could not find or load main class HelloWorld". This error message applies to all my other projects in the same workspace. I've tried switching workspaces but the error still appears.

我使用的是 64 位 Windows 7.任何帮助将不胜感激!

I'm on Windows 7 64-bit. Any help would be appreciated!

推荐答案

今天我更新了 JRE 后发生了这种情况.我清理了项目,它又开始工作了.

This just happened to me today after updating my JRE. I cleaned the project and it started working again.

项目 ->Clean 将删除任何现有的类文件并完全重建项目.在这里有更多关于 Eclipse 的清理功能的信息.

Project -> Clean will remove any existing class files and completely rebuild the project. There's more information on Eclipse's clean function here.

这篇关于Eclipse 错误:找不到或无法加载主类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆