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.
我最近开始在我的Java servlet项目中使用Eclipse。我一直在使用jEdit多年,这是一个超级强大的文本编辑器。它具有语法高亮,但它没有任何特定于语言的功能,如代码完成和智能重构。我发现这会妨碍我的工作效率。我非常想要喜欢Eclipse。我真的这样做。但问题发生后我一直遇到问题。
- 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.
- 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.
- 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).
- 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.
现在Eclipse可以使用ant脚本来构建,而不是仅仅从ant脚本创建自己的构建环境,然后忽略对它的任何更改,我找到了一些在线指南并进行了设置。但是,它似乎还没准备好迎接黄金时段。我的ant脚本从命令行构建得很好,但是我得到了所有这些构建错误,因为我需要告诉Eclipse build.xml中已经有的所有这些东西,比如CLASSPATH,以及外部jar。
当我让Eclipse运行太久时,或者有时候我的笔记本电脑从休眠状态唤醒后,UI开始崩溃。例如,编辑器窗格上的选项卡会消失,因此我一次只能编辑一个文件,而不会说明它是哪一个。
我们遇到了几个不应该重建类的实例,导致调试演练中的行号不准确以及其他不可预测的行为(这不仅仅是我;其他两个开发人员在我身上试图看到同样的事情)。
我发现工作区与源代码位于不同的地方是一件很麻烦的事。我有其他需要编辑的文件(xml文件等),对于我想要编辑文件的每个目录,我需要设置一个特殊的条目,它甚至不会默认设置我的源代码所在的位置那个。
Do others face these same issues?
其他人是否面临同样的问题?
Are there better alternatives?
还有更好的选择吗?
11 个解决方案
#1
4
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.
面向软件开发人员的免费开源集成开发环境。您将获得使用Java语言,C / C ++和Ruby创建专业桌面,企业,Web和移动应用程序所需的所有工具。
#2
12
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.
如果将项目文件夹结构保留给其管理,Eclipse最有效。我们正在与15个开发人员合作开发一个包含数千个类的项目,甚至还有更多的XML和.properties文件。
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.
我同意ANT集成存在问题,因此对于生产和夜间构建,我建议使用基于从shell启动的ANT脚本的外部构建系统。
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.
但是,在Eclipse中工作时,请确保您具有自动构建功能(默认情况下应该是这样,但检查不会受到影响)。这可以让您免于任何关于构建和何时构建的问题。有时(对我来说很少),当我必须切换自动构建,清理所有项目并通过菜单触发手动构建时会出现问题。有时我不得不多次触发构建(不是清理!),但是一旦所有内容再次构建完毕,打开自动构建就会再次发挥作用。
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.
至于长时间运行的实例:我的机器基本上一直(白天和黑夜)保持登录,并且至少有两个Eclipse实例一直在运行。我没有看到这些会议有任何问题,即使他们在几周内保持开放。
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.
我在使用Eclipse的5年中遇到的大多数问题都源于安装了太多插件的人 - 我添加的唯一内容是Checkstyle,“实现者插件”以及我们正在使用的应用程序框架的一些专有内容。
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).
也许您可以尝试使用相当干净的Eclipse安装“常用方法”一段时间(即将源导入工作区文件夹)。
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.
关于NetBeans:我也经常使用它,但我认为这是一个品味问题,我更喜欢Eclipse。这对你来说可能有所不同。
#3
5
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.
我喜欢IntelliJ,但它很商业化。与它相比,Eclipse感觉就像一个越野车,半心半意的仿冒品。至于IntelliJ的价值成本。
#4
1
Eclipse can be quite a change, especially coming from something like just a text editor, or Visual Studio
Eclipse可能是一个很大的变化,特别是来自文本编辑器或Visual Studio
-
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.
尝试让Eclipse自己构建项目,而不需要ant的帮助。将ant留给手写的build.xml文件,从eclipse之外的命令行构建项目,例如,在你的构建/发布机器上。
-
low on memory?
内存不足?
-
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.
你是否在使用ant构建项目之间来回,然后让Eclipse尝试构建项目?那些建筑物是否相互“战斗”?见1。
-
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?
是的,你需要习惯的事情之一......接受而不是战斗“蚀食方式”;你必须将你的工作源文件放在某处,那为什么不在Eclipse的工作区文件夹中?
hope that helps/makes sense
希望有所帮助/有意义
#5
1
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.
像其他人已经建议的那样:除了Eclipse之外,还有更多优秀的Java IDE。 Eclipse的优点是插件系统。有很多可用的功能,其中一些确实非常好。那就是说:我现在不使用Eclipse,而是使用NetBeans。 NetBeans感觉不那么笨重,响应更快,感觉更干净。
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.
当我的主要工作是Java编程时,我已经使用了IntelliJ。就编码而言,IMHO IntelliJ击败了NetBeans和Eclipse。它更快,具有更好的重构可能性,更好的搜索,快速导航和列表继续。
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...
在很大程度上,选择IDE只是品味和经验的问题。很多人对他们所知道的魔鬼感到更加满意......
#6
1
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.
对于问题1,您可以为eclipse设置自定义构建器。为此,请右键单击“项目”,然后选择“属性”。在左边有一个名为Builders的项目,选择它。
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.
根据您的说法,您将需要删除Java构建器并将其替换为新的Ant构建器。这可以通过单击New并选择Ant Builder来完成。这将带来一些配置来填写。
In the configuration, the two most important parts are the Build File in the Main tab and the Targets tab.
在配置中,两个最重要的部分是Main选项卡中的Build File和Targets选项卡。
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.
对于问题4,我建议您的项目尝试独立于其在光盘上的位置。这样一切都在同一棵树上。否则,解决方案是设置外部目录。从听起来来看,并非一切都在同一个“源树”中,这会带来源控制问题。
#7
0
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.
我发现工作区与源代码位于不同的地方是一件很麻烦的事。我有其他需要编辑的文件(xml文件等),对于我想要编辑文件的每个目录,我需要设置一个特殊的条目,它甚至不会默认设置我的源代码所在的位置那个。
... you can configure the location of both your workspace and your source code, if you want.
...如果需要,您可以配置工作区和源代码的位置。
#8
0
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.
我在Eclipse中的大部分时间都花在了ColdFusion上,所以我不能说ANT脚本或编译。我也注意到,如果Eclipse运行了一段时间,那么更有可能发生奇怪的事情。除此之外,通过确保我的JRE是最新版本,可以解决大多数其他错误问题。
#9
0
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.
正如其他人所提到的,尝试NetBeans,它类似于Eclipse,因为它是一个支持IDE的平台,并且是基于插件的。它的构建系统也基于Ant,允许您在各种扩展点进行点击。总的来说,我发现它比Eclipse更稳定,但是YMMV。
#10
0
We have eclipse manage things the way it wants, and use ant4eclipse (a set of ant tasks) for continuous builds. Works great!
我们按照自己想要的方式管理eclipse,并使用ant4eclipse(一组ant任务)进行连续构建。效果很好!
#11
0
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.
Eclipse是一个很棒的工具。在我使用它的很多年里,它几乎没有遇到任何问题。我总是惊讶于这么多人如何遇到问题。然后,我将它用作一个相当基本的编辑器。我要么幸运,要么我缺乏问题源于这样一个事实,即我不认为它不仅仅是一个聪明的编辑器。
#1
4
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.
面向软件开发人员的免费开源集成开发环境。您将获得使用Java语言,C / C ++和Ruby创建专业桌面,企业,Web和移动应用程序所需的所有工具。
#2
12
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.
如果将项目文件夹结构保留给其管理,Eclipse最有效。我们正在与15个开发人员合作开发一个包含数千个类的项目,甚至还有更多的XML和.properties文件。
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.
我同意ANT集成存在问题,因此对于生产和夜间构建,我建议使用基于从shell启动的ANT脚本的外部构建系统。
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.
但是,在Eclipse中工作时,请确保您具有自动构建功能(默认情况下应该是这样,但检查不会受到影响)。这可以让您免于任何关于构建和何时构建的问题。有时(对我来说很少),当我必须切换自动构建,清理所有项目并通过菜单触发手动构建时会出现问题。有时我不得不多次触发构建(不是清理!),但是一旦所有内容再次构建完毕,打开自动构建就会再次发挥作用。
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.
至于长时间运行的实例:我的机器基本上一直(白天和黑夜)保持登录,并且至少有两个Eclipse实例一直在运行。我没有看到这些会议有任何问题,即使他们在几周内保持开放。
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.
我在使用Eclipse的5年中遇到的大多数问题都源于安装了太多插件的人 - 我添加的唯一内容是Checkstyle,“实现者插件”以及我们正在使用的应用程序框架的一些专有内容。
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).
也许您可以尝试使用相当干净的Eclipse安装“常用方法”一段时间(即将源导入工作区文件夹)。
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.
关于NetBeans:我也经常使用它,但我认为这是一个品味问题,我更喜欢Eclipse。这对你来说可能有所不同。
#3
5
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.
我喜欢IntelliJ,但它很商业化。与它相比,Eclipse感觉就像一个越野车,半心半意的仿冒品。至于IntelliJ的价值成本。
#4
1
Eclipse can be quite a change, especially coming from something like just a text editor, or Visual Studio
Eclipse可能是一个很大的变化,特别是来自文本编辑器或Visual Studio
-
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.
尝试让Eclipse自己构建项目,而不需要ant的帮助。将ant留给手写的build.xml文件,从eclipse之外的命令行构建项目,例如,在你的构建/发布机器上。
-
low on memory?
内存不足?
-
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.
你是否在使用ant构建项目之间来回,然后让Eclipse尝试构建项目?那些建筑物是否相互“战斗”?见1。
-
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?
是的,你需要习惯的事情之一......接受而不是战斗“蚀食方式”;你必须将你的工作源文件放在某处,那为什么不在Eclipse的工作区文件夹中?
hope that helps/makes sense
希望有所帮助/有意义
#5
1
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.
像其他人已经建议的那样:除了Eclipse之外,还有更多优秀的Java IDE。 Eclipse的优点是插件系统。有很多可用的功能,其中一些确实非常好。那就是说:我现在不使用Eclipse,而是使用NetBeans。 NetBeans感觉不那么笨重,响应更快,感觉更干净。
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.
当我的主要工作是Java编程时,我已经使用了IntelliJ。就编码而言,IMHO IntelliJ击败了NetBeans和Eclipse。它更快,具有更好的重构可能性,更好的搜索,快速导航和列表继续。
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...
在很大程度上,选择IDE只是品味和经验的问题。很多人对他们所知道的魔鬼感到更加满意......
#6
1
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.
对于问题1,您可以为eclipse设置自定义构建器。为此,请右键单击“项目”,然后选择“属性”。在左边有一个名为Builders的项目,选择它。
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.
根据您的说法,您将需要删除Java构建器并将其替换为新的Ant构建器。这可以通过单击New并选择Ant Builder来完成。这将带来一些配置来填写。
In the configuration, the two most important parts are the Build File in the Main tab and the Targets tab.
在配置中,两个最重要的部分是Main选项卡中的Build File和Targets选项卡。
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.
对于问题4,我建议您的项目尝试独立于其在光盘上的位置。这样一切都在同一棵树上。否则,解决方案是设置外部目录。从听起来来看,并非一切都在同一个“源树”中,这会带来源控制问题。
#7
0
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.
我发现工作区与源代码位于不同的地方是一件很麻烦的事。我有其他需要编辑的文件(xml文件等),对于我想要编辑文件的每个目录,我需要设置一个特殊的条目,它甚至不会默认设置我的源代码所在的位置那个。
... you can configure the location of both your workspace and your source code, if you want.
...如果需要,您可以配置工作区和源代码的位置。
#8
0
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.
我在Eclipse中的大部分时间都花在了ColdFusion上,所以我不能说ANT脚本或编译。我也注意到,如果Eclipse运行了一段时间,那么更有可能发生奇怪的事情。除此之外,通过确保我的JRE是最新版本,可以解决大多数其他错误问题。
#9
0
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.
正如其他人所提到的,尝试NetBeans,它类似于Eclipse,因为它是一个支持IDE的平台,并且是基于插件的。它的构建系统也基于Ant,允许您在各种扩展点进行点击。总的来说,我发现它比Eclipse更稳定,但是YMMV。
#10
0
We have eclipse manage things the way it wants, and use ant4eclipse (a set of ant tasks) for continuous builds. Works great!
我们按照自己想要的方式管理eclipse,并使用ant4eclipse(一组ant任务)进行连续构建。效果很好!
#11
0
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.
Eclipse是一个很棒的工具。在我使用它的很多年里,它几乎没有遇到任何问题。我总是惊讶于这么多人如何遇到问题。然后,我将它用作一个相当基本的编辑器。我要么幸运,要么我缺乏问题源于这样一个事实,即我不认为它不仅仅是一个聪明的编辑器。