如何通过Eclipse获取类文件?

发布于 2024-08-21 10:57:05 字数 255 浏览 6 评论 0原文

我在Eclipse中编写了一个应用程序,已成功编译并运行。之后,在相应的目录中我找到了*.java和*.class文件。然后我删除了 *.class 文件,现在我不知道如何恢复它。

Eclipse 写信给我“未编写类文件。项目可能不一致,如果是这样,请尝试刷新此项目并构建它”。

通过右键单击该项目,我得到一个下拉菜单,在其中找到“刷新”,但我无法找到如何“构建”该项目。

那么,如何重新生成class文件呢?

预先感谢您的帮助。

I wrote an application in the Eclipse, which was successfully compiled and run. After that, in a corresponding directory I found *.java and *.class files. Then I have deleted the *.class file and now I do not know how can I get it back.

Eclipse writes me "A class file was not written. The project may be inconsistent, if so try refreshing this project and building it".

By the right click on the project I got a drop down menu in which I found "Refresh" but I cannot find out how can I "build" the project.

So, how can I generate the class file again?

Thank you in advance for any help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

对岸观火 2024-08-28 10:57:05
  1. 清理项目应该足以开始构建。 菜单:项目 -> 清理
  2. 检查自动构建是否已启用。 项目->自动构建
  3. 如果自动构建被禁用,请使用构建全部。 菜单:项目->构建全部
  1. Cleaning the project should be enough to start the build. Menu:Project ->Clean
  2. Check that automatic build is enabled. Project -> Build Automatically
  3. If automatic build is disabled use build all. Menu: Project -> Build All
鹤仙姿 2024-08-28 10:57:05

当我有一个内部类,并且主类及其内部类的总名称超过 128 个字符时,我会收到此错误消息。 OpenJDK 和 Sun JDK 6 上都会发生这种情况。我的解决方案是缩短内部类名称。

I get this error message when I have an inner class, and the total name of the main class and its inner classes exceeds 128 characters. This happens both on OpenJDK and Sun JDK 6. The solution for me was to shorten the inner class names.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文