Tweaking Eclipse

I use Eclipse almost every day at work for Java development. It isn’t the best piece of software out there but it mostly works, has a plethora of features and you can’t beat the price!

I do have to make several changes to the default settings to make Eclipse work according to my tastes. However, these changes are linked to a workspace and thus, every time that I create a new workspace, I have to remember the tweaks and re-do them.

So here’s my attempt at listing them all out so I have a quick reference the next time I need to setup Eclipse.

Installation

Head to eclipse.org/downloads/ and get the relevant Eclipse bundle. The Eclipse IDE for Java Developers is what would generally suit me as a core Java developer. However, I find this bundle to contain unnecessary features (integrated CVS client, really?!) and prefer building up from a base installation starting with just the Eclipse Platform Runtime Binary. Unfortunately, the Eclipse folks keep re-organizing their site and each time, I’ve to hunt for the download location for the platform binary package. A bit of web searching should help here.

Once you’ve installed just the base Eclipse platform runtime, you can add the relevant plugins from within Eclipse. Go to Help > Install New Software or Help > Eclipse Marketplace and search for the required features.

My current list of plugins:

Startup

Eclipse is a memory hog. It is unlikely that the default memory settings will give you a decent experience so it is best to change them. Edit the eclipse.ini file (lives next to eclipse.exe) as follows:

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Xms40m
-Xmx512m

The first few lines should already be present in the file. Add the memory related args with values suited to your development machine.

Configuration

Finally, time to tweak some preferences. These need to be set for each new workspace that you create.

Open the Window > Preferences dialog and change the following:

Ideally, you should be able to File > Export > General > Preferences from one workspace and then File > Import > General > Preferences into a new workspace. But it takes only a couple of minutes to make the above config changes and I don’t have to worry that Eclipse screwed up something else under the covers. :-)