Some days in the past I decided to try out eclipse 3.3.2. A lot of people are using it here in Germany and especially companies develop new plugins for it – it is a kind of an industry standard. I always felt a little bit hassle when people are talking about eclipse and say it is better than NetBeans. I only knew NetBeans, so I didn’t know if and where they are right and where not. So this blog entry collects some experiences I made while exploring eclipse.
Please, feel free to post your favorite eclipse feature as a comment.
I explored the following features:
- Generating the serialVersionUID for serializeable classes – just with one click (CTRL+1).
- Spell checking while editing! Very useful!!
- Eclipse suggests possible keybord bindings if you e.g. type SHIFT+ALT+X. This is especially useful for newbies or for discovering features of e.g. new versions.
- I have the feeling that the startup is faster and the GUI is more responsive in the first minutes (compared to NB 6.0), although sometimes something strange happens and the IDE freezes for several ten seconds (?).
and the following drawbacks:
- Fat size for pure Java Developer package (approx. 80 MB for gtk download)
- For every OS you have to download another package (there is and will be no such OS independent zip, because eclipse is based on SWT, right?)
- I don’t understand the workspace concept -wherefor we need it?? My friend Gregor explained it to me. If you have several big projects, where each big project has several eclipse projects. Then every big project gets its own workspace, which can save different properties, like default JDK etc.
My friend Gregor – the author of Moonlight | 3D – explained me some more details of eclipse. Thanks to him, again!
- Formatting of Java (or xml) code can be done via CTRL+SHIFT+F. But here the greate difference to netbeans is that you can define different formatting styles for each project and apply them via this keyboard shortcut! Access this via: Right click on the project->Properties->Java Code Style-> Formatter->Enable project specific settings
- It is possible to add necessary and remove unnecessary imports via CTRL+SHIT+O. The great thing here is, that you can apply this action on several files easily. Via clicking on a package (with several files in it) and press the short cut (or right click the package->Source->Organize Imports). The same is true for formatting the source code.
- If you want that the debugging will break on every exception (dynamic breakpoint creation), then enable this via: (Menu) Run->Add Java Exception Breakpoint
- Update process can be done in background (Update via: Help->Software Updates)
- Mylyn is a great tool for bug tracking. You will indirectly assign source files to bug reports.
- There are several plugins available; even commercial. And a lot of vendors publish there adapted version of the eclipse IDE to make it easier for the user.
- The plugin and distribution hell – there are a lot of plugins, which are useful for basic Java development, but are not installed per default. E.g. the VE (Visual Editor for Swing or SWT development) is currently not available for eclipse 3.3.
- There is a profiler, but Gregor means that it is the hell to run it (compared to the netbeans one.)
Good to know:
- TPTP = Test Performance Tools Platform
- Feature Overview via Help->About Eclipse Platform->Feature Details. A feature is a set of plugins.
- Execute a Java program via F11 and debug it with CTRL F11.
- Rename a variable (etc.) with ALT+SHIFT+R
- Subversion via right click on the project->Team. Then: ‘Share…’ means import into a new repository. You can install Subclipse or Subversive to use this.
- Find Usage via ‘References’ (Right click in the source editor)
- There are two preferences of the Java editor: Window->Preferences->Java->Editor->General->Editors or Window->Preferences->General->Editors
Eclipse is a nice IDE for Java development and now I know why people are happy with eclipse, although I think NetBeans offers a compareable rich set of features. Maybe every IDE has its scope of usage. I think the reason for the ‘IDE war’ is not that one tool is better than another (this would be too easy), but it is more a war of some people to legitimate their laziness to NOT trying the other IDE(s) in detail. A future candidate for me is definitely IntelliJ, which is free for open source projects.
For some great video tutorials look here.