是我的问题,还是 Eclipse 太不可预测了?

发布于 2024-07-04 05:49:57 字数 792 浏览 3 评论 0原文

我最近开始在工作中使用 Eclipse 来处理我的 Java servlet 项目。 我使用 jEdit 已经很多年了,它是一个非常强大的文本编辑器。 它具有语法突出显示功能,但没有任何特定于语言的功能,例如代码完成和智能重构。 我发现这阻碍了我的工作效率。 我非常想要喜欢Eclipse。 我真的这么做。 但我不断遇到一个又一个的问题。

  1. 现在 Eclipse 可以使用 ant 脚本来构建,而不是仅仅从 ant 脚本创建自己的构建环境,然后忽略对其进行的任何更改,我找到了一些在线指南并进行了设置。 不过,它似乎还没有准备好迎接黄金时段。 我的 ant 脚本从命令行构建得很好,但是我得到了所有这些构建错误,因为我需要告诉 Eclipse build.xml 中已经包含的所有内容,例如 CLASSPATH 以及外部 jar 的位置。
  2. 当我让 Eclipse 运行太长时间时,或者有时在我的笔记本电脑从休眠状态唤醒后,UI 就会开始损坏。 例如,编辑器窗格上的选项卡消失了,所以我一次只能编辑一个文件,而且它没有说明它是哪一个。
  3. 我们遇到过一些实例,其中应该重建的类没有被重建,从而导致调试演练中的行号不准确以及其他不可预测的行为(这不仅仅是我;与我一起尝试的另外两个开发人员也看到了同样的事情)。
  4. 我发现工作区与我的源代码位于不同的位置是一个巨大的麻烦。 我还有其他需要编辑的文件(xml 文件等),对于我想要编辑文件的每个目录,我需要设置一个特殊的条目,并且在设置时它甚至不默认为我的源代码所在的位置就这样。

其他人也面临同样的问题吗?

有更好的选择吗?

I recently started using Eclipse at work for my Java servlet projects. I've been using jEdit for years, which is a uber-powerful text editor. It has syntax highlighting, but it doesn't have any language-specific features like code completion and intelligent refactoring. I'm finding that's hindering my productivity. I desperately want to like Eclipse. I really do. But I keep running into problem after problem.

  1. Now that Eclipse can use an ant script to build, instead of just creating its own build environment from an ant script then ignoring any changes to it, I found some online guides and set it up. It doesn't seem ready for prime time, though. My ant script builds fine from the command line, but I get all these build errors because I need to tell Eclipse all this stuff the build.xml already has in it, like the CLASSPATH, and where external jars are.
  2. When I leave Eclipse running for too long, or sometimes after my laptop wakes up from hibernate, the UI starts breaking. For instance, the tabs on the editor pane disappear, so I can only edit one file at a time, and it doesn't say which one it is.
  3. We have faced several instances where classes weren't rebuilt that should have been, leading to inaccurate line numbers in debugging walkthroughs and other unpredictable behavior (this isn't just me; the two other developers trying it out with me are seeing the same thing).
  4. I find it a huge hassle that the workspace is in a different place than my source code. I have other files I need to edit (xml files, etc), and for each directory I want to edit files in, I need to set up a special entry, and it doesn't even default to where my source code is when setting that up.

Do others face these same issues?

Are there better alternatives?

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

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

发布评论

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

评论(11

明月松间行 2024-07-11 05:49:57

Eclipse 是一个很棒的工具。 在我使用它的这么多年里,几乎没有遇到过任何问题。 令我惊讶的是,这么多人都会遇到问题。 话又说回来,我将它用作一个相当基本的编辑器。 我要么很幸运,要么我没有遇到任何问题,因为我并不期望它不仅仅是一个智能编辑器。

Eclipse is a great tool. Hardly ever had problems with it in the many years that I've used it. It always amazes me how so many people can have problems with it. Then again, I'm using it as a fairly basic editor. I'm either lucky or my lack of problems stems from the fact that I'm not expecting it to be much more than a smart editor.

漆黑的白昼 2024-07-11 05:49:57

我们让 eclipse 按照它想要的方式管理事物,并使用 ant4eclipse(一组 ant 任务)进行连续构建。 效果很好!

We have eclipse manage things the way it wants, and use ant4eclipse (a set of ant tasks) for continuous builds. Works great!

锦欢 2024-07-11 05:49:57

正如其他人提到的,尝试 NetBeans,它与 Eclipse 类似,它是一个支持 IDE 的平台,并且是基于插件的。 它的构建系统也已经基于 Ant,允许您利用各种扩展点。 总的来说,我发现它也比 Eclipse 稳定一点,但是 YMMV。

As someone else has mentioned, try NetBeans, It's similar to Eclipse in that it is a platform that supports an IDE, and is plug-in based. Its build system is also already based around Ant, allowing you to tap in at various extension points. In general, I've found it a bit more stable than Eclipse as well, but YMMV.

怪异←思 2024-07-11 05:49:57

我在 Eclipse 中的大部分时间都花在了 ColdFusion 上,所以我无法使用 ANT 脚本或编译。 我也注意到,如果 Eclipse 运行时间过长,就会更有可能发生奇怪的事情。 除此之外,大多数其他错误都可以通过确保我的 JRE 是最新版本来解决。

Most of my time in Eclipse has been spent doing ColdFusion so I can't speak to ANT scripts or compilation. I too noticed that odd things would be more likely to happen if Eclipse was left running for an excessive amount of time. Aside from that, most other buggy-ness could be resolved by making sure that my JRE was the latest version.

被翻牌 2024-07-11 05:49:57

部分回答,希望对您有帮助

4<代码>。 我发现工作区与我的源代码位于不同的位置是一个巨大的麻烦。 我还有其他需要编辑的文件(xml 文件等),对于我想要编辑文件的每个目录,我需要设置一个特殊的条目,并且在设置时它甚至不默认为我的源代码所在的位置就这样。

...如果需要,您可以配置工作区和源代码的位置。

Partial, hopefully helpful answer to

4. I find it a huge hassle that the workspace is in a different place than my source code. I have other files I need to edit (xml files, etc), and for each directory I want to edit files in, I need to set up a special entry, and it doesn't even default to where my source code is when setting that up.

... you can configure the location of both your workspace and your source code, if you want.

腻橙味 2024-07-11 05:49:57

就像其他一些人已经建议的那样:除了 Eclipse 之外,还有更多优秀的 Java IDE。 Eclipse 的强项是插件系统。 有大量可用的功能,其中一些确实非常好。 也就是说:我目前不使用 Eclipse,而是使用 NetBeans。 NetBeans 感觉不那么笨重,响应更快,而且感觉更干净。

当我的主要工作是 Java 编程时,我经常使用 IntelliJ。 恕我直言,就编码而言,IntelliJ 击败了 NetBeans 和 Eclipse。 它速度更快,具有更好的重构可能性、更好的搜索、快速导航,等等。

在很大程度上,选择 IDE 取决于品味和经验。 很多人对他们认识的魔鬼感到更快乐......

Like some other people already have suggested: there are more good Java IDEs besides Eclipse. The strong point of Eclipse is the plug-in system. There's a wealth of functionality available and some of it is indeed very good. That said: I do not use Eclipse, but NetBeans at the moment. NetBeans feels less clunky, is more responsive and has a cleaner feel.

When my main job was Java programming I've used IntelliJ a lot. IMHO IntelliJ beats both NetBeans and Eclipse as far as coding is concerned. It's faster, has better refactoring possibilities, better search, quick navigation and the list goes on.

To a large extent, picking an IDE is a matter of taste, as well as experience. A lot of people feel more happy with the devil they know...

因为看清所以看轻 2024-07-11 05:49:57

对于第 1 个问题,您可以为 Eclipse 设置自定义构建器。 为此,请右键单击该项目并选择“属性”。 左侧有一个名为 Builders 的项目,选择它。

根据您所说的,您将需要删除 Java 构建器并将其替换为新的 Ant 构建器。 这可以通过单击 New 并选择 Ant Builder 来完成。 这将弹出一些需要填写的配置。

在配置中,最重要的两个部分是“Main”选项卡中的“Build File”和“Targets”选项卡。

对于第 4 期,我建议您的项目尝试独立于其在光盘上的位置。 这样一切都在同一棵树上。 否则,解决方案是设置外部目录。 听起来,并非所有内容都在同一个“源代码树”中,这会带来源代码控制问题。

For issue number 1, you can setup custom builders for eclipse. To do so, right click on the Project and select Properties. On the left there is a item called Builders, select that.

Based off of what you are saying, you will want to remove the Java builder and replace it with a new Ant Builder. This can be done by clicking New and selecting Ant Builder. This will bring up a some configuration to fill out.

In the configuration, the two most important parts are the Build File in the Main tab and the Targets tab.

For issue 4, I would recommend having your project try to be independent of its location on disc. That way everything is in the same tree. Otherwise, the solution would be to setup external directories. From what it sounds like, not everything is in the same 'source tree', which brings up source control issues.

淡忘如思 2024-07-11 05:49:57

Eclipse 可能是一个相当大的变化,特别是来自像文本编辑器或 Visual Studio 这样的东西

  1. 尝试让 Eclipse 自己构建项目,而不需要 ant 的帮助。 将 ant 留给手写的 build.xml 文件,以便从 eclipse 外部的命令行构建项目,例如,在您的构建/发布机器上。

  2. 内存不足?

  3. 您是否要在使用 ant 构建项目和让 Eclipse 也尝试构建项目之间来回切换? 即,构建是否相互“战斗”? 请参阅 1。

  4. 是的,您需要习惯的事情之一...接受而不是对抗“日食方式”; 你必须将你的工作源文件放在某个地方,那么为什么不放在 Eclipse 的工作区文件夹中呢?

希望有帮助/有意义

Eclipse can be quite a change, especially coming from something like just a text editor, or Visual Studio

  1. try to let Eclipse build the project itself, without the help of ant. Leave ant to a handwritten build.xml file to build the project from the command line outside of eclipse, e.g., on yer build/release machine.

  2. low on memory?

  3. are you going back and forth between building the project w/ant and then having Eclipse trying to build the project too? i.e., are the builds "fighting" with each other? see 1.

  4. yes, one of the things that you would need to get used to... accept, rather than fight, the "eclipse way"; you have to put your working source files somewhere, then why not in Eclipse's workspace folder?

hope that helps/makes sense

星星的轨迹 2024-07-11 05:49:57

我喜欢 IntelliJ,但它是商业性的。 与它相比,Eclipse 感觉就像是一个有缺陷的、半心半意的山寨货。 就这一点来说,IntelliJ 是值得的。

I love IntelliJ, but it's commercial. Eclipse feels like a buggy, half-hearted knockoff compared to it. To the point that IntelliJ's worth the cost.

熟人话多 2024-07-11 05:49:57

尝试 NetBeans

免费、开源的集成
软件开发环境
开发商。 你会得到所有你需要的工具
需要创建专业桌面,
企业、网络和移动
使用Java语言的应用程序,
C/C++ 和 Ruby。

Try NetBeans

A free, open-source Integrated
Development Environment for software
developers. You get all the tools you
need to create professional desktop,
enterprise, web, and mobile
applications with the Java language,
C/C++, and Ruby.

空心空情空意 2024-07-11 05:49:57

如果您将项目文件夹结构留给 Eclipse 管理,则 Eclipse 的工作效果最佳。 我们正在与 15 名开发人员合作开发一个包含数千个类以及更多 XML 和 .properties 文件的项目。

我同意 ANT 集成存在问题,因此对于生产和夜间构建,我建议使用基于从 shell 启动的 ANT 脚本的外部构建系统。

然而,在 Eclipse 中工作时,请确保打开了自动构建功能(默认情况下应该是这样,但检查不会有什么坏处)。 这将使您不再担心构建什么以及何时构建。 有时(对我来说很少)当我必须切换自动构建、清理所有项目并通过菜单触发手动构建时,会出现问题。 有时我必须多次触发构建(而不是清理!),但是一旦所有内容都再次构建,打开自动构建就会再次正常工作。

至于长时间运行的实例:我的机器基本上一直保持登录状态(白天和晚上),并且至少有两个 Eclipse 实例始终在运行。 我没有发现这些会议有任何问题,即使它们开放了几周。

在我使用 Eclipse 的 5 年里,我看到的大多数问题都源于人们安装了太多插件 - 我添加的唯一东西是 Checkstyle、“实现者插件”以及我们正在使用的应用程序框架的一些专有东西。

也许您可以尝试以“通常的方式”使用相当干净的 Eclipse 安装一段时间(即,将源导入到工作区文件夹中)。

关于 NetBeans:我也时不时地使用它,但我认为这是一个品味问题,而且我更喜欢 Eclipse。 这对你来说可能会有所不同。

Eclipse works best if you leave the project folder structure to its management. We are working with 15 developers on a project of several thousand classes and even more XML and .properties files.

I agree there are problems with ANT integration, so for production and nightly builds I recommend an external build system based on ANT scripts started from a shell.

However while working in Eclipse make sure you have the automatic build feature on (it should be by default, but checking does not hurt). This should free you from any concerns regarding what to build and when. Sometimes (very rarely for me) there are problems when I have to switch of the automatic build, clean all projects and trigger a manual build via the menu. From time to time I have to trigger the build multiple times (not the cleaning!), but once everything has been built again, turning the auto-build on works great again.

As for long running instances: My machine keeps logged in basically all the time (day and night) and there are at least two Eclipse instances running at all times. I have not seen any problems with these sessions, even when they remain open for literally weeks.

Most of the problems I have seen in the 5 years I have been using Eclipse originated from people installing too many plugins - the only stuff I have added is Checkstyle, the "implementors plugin" and some proprietary stuff for the application framework we are using.

Maybe you can try using a rather clean Eclipse installation the "usual way" for a while (i. e. with the sources imported to the workspace folder).

Regarding NetBeans: I use it from time to time as well, but I think it is a matter of taste and I like Eclipse better. This may be different for you.

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