系统崩溃后 Eclipse 的行为不一致
我有一个关于 Eclipse 的紧急且令人费解的问题。今天早上我的系统崩溃了,重新启动后,我可以在 Eclipse 中完美运行程序,方法是右键单击 Java 文件并选择“作为 Java 应用程序运行”。但是,在我将项目制作成 .jar 文件并执行该文件后,程序的行为根本不反映代码的作用。
我已经检查过我正在编译正确的项目,并且在 Eclipse 中运行同一项目中的相同代码不会导致任何问题。顺便说一句,我正在使用一个名为 fat jar 的插件来编译 .jar 文件,如果这有什么区别的话。我之前曾多次使用同一个插件来编译同一个项目,但从未遇到过任何问题。
有谁知道什么可能导致 Eclipse 这种奇怪/不一致的行为?我需要重新安装 Eclipse 和 fat jar 来解决这个问题吗?谢谢。
I have an urgent and puzzling problem with Eclipse. My system crashed on itself this morning, and after I rebooted, I can run a program perfectly within Eclipse, by right-click on the Java file and choose 'Run as Java Application'. However, after I make the project into a .jar file, and execute that, the behavior of the program simply does not reflect what the code does.
I have checked that I am compiling the right project, and running the same code from the same project within Eclipse does not cause any problem. And btw, I am using a plug-in called fat jar to compile the .jar file, if that makes any difference. I have used the same plug-in numerous times before to compile the very same project, and never had any problem.
Does anyone know what might be causing this weird/inconsistent behavior of Eclipse? Do I need to re-install Eclipse and fat jar to fix this? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于像这样的奇怪事情,我通常的程序是,
A)清理并再次构建,即项目 - > Clean
B)(与 Eclipse 无关)由于我通常使用构建工具,因此从该工具中执行相同的操作以确保其 Eclipse。
C) 如果情况变得非常糟糕,我将启动一个新的 Eclipse 工作区并从那里开始尝试。
D)如果在事情变得奇怪之前我刚刚安装了一个新插件,我会考虑重新安装
My usual procedure for strange things like this is,
A) Clean and build again i.e. Project -> Clean
B) (not so eclipse related) Since I am usually using a build tool, do the same thing from the tool to ensure its eclipse.
C) If it gets really bad, I'll start a new eclipse workspace and try from there.
D) Iff I had just installed a new plugin before things went strange I'd think about reinstalling
听起来很奇怪:)
但 Eclipse 以前可能表现得很奇怪,而且也确实表现得很奇怪。这些年来,我在 Java、C++ 和 PHP 开发中都遇到过问题,只能通过重新安装 Eclipse 来解决。您或许可以通过四处挖掘来修复它,但是在 Eclipse 中查找并修复这些类型的奇怪问题所花费的时间根本不值得。
祝你好运!
It sounds extremely strange :)
But Eclipse can, and has, acted strange before. I have had problems in both Java, C++ and PHP development during the years that could only be fixed with a resinstall of Eclipse. You could probably fix it by digging around, but the time it takes to find and fix these types of strange problems in Eclipse is simply not worth it.
Good luck!
请先尝试重置透视图(在重新安装 eclipse 之前)
Please try to Reset Perspective first (Before reinstall eclipse)