Changing Eclipse Syntax Colors

The Eclipse IDE, as we all know, is like a huge battleship. It's loaded with functionality. Its got a crazy amount of plugins you can load to increase its size, and configure, ugh. It's ancient in some ways, while trying to be modern. It's a big IDE program. My Eclipse folder currently clocks in at 208Mb. That's a big application. In contrast my NetBeans folder clocks in at 144MB. Who says I can't load more than one IDE at a time.

I, like all the rest of you out there who use IDE editors, like color syntax highlighting. It just makes coding so much more pleasurable, and less error prone. And I must admit that I'm forever twiddling with my colors to get them just the way I want them. There always seems to be some color that I just want to make lighter or darker.

The Eclipse Changing Color Preference Nightmare


Have you ever tried to change your colors in Eclipse? What a nightmare! If anyone would like to try, go to Window->Preferences, and there you can configure most anything in Eclipse including plugins. If you want to take a crack at the colors, in the menu search box in the preferences menu, type "color". Where do you start, and more important which setting takes precedence over another setting. I've never figured it out.

There's another problem, which is so exasperating that it's caused me to load NetBeans. Because of all the plugins, each having their own settings, every once in awhile you run into conflicts and collisions. And that's Eclipse's big "Achilles Heel". Conflicts cause crashes, and crashes some times wipe out your workbench, which means you have to reload all your projects and start over, including starting to readjust your colors from the beginning. When it happens in the middle of a big project, you get so frustrated you never want to use Eclipse again, well maybe not that drastic, but as I said, I have loaded NetBeans, which in contrast, is a pleasure to configure.

The Eclipse developers are aware of the problem and have tried to make life simpler, especially for those switching computers, by offering an import and export of your Eclipse preference files. To save your preferences go to File-> Export-> General-> Preferences. This will create an .epf file that you should promptly save to a jump drive for future installations, in case you crash Eclipse and don't want to reconfigure everything. To bring all your settings back, you simply click on File->Import and load you .epf file.

That's still not the answer to changing your colors, though. Questions like, where do you change that one color that's been bugging you, and should I change any colors, because it might crash my system, come to mind.

I just discovered a plugin that rides to the rescue to save the day, and the dude in distress. The plugin is called the Eclipse Color Themes Plugin, and it takes care of your Eclipse Color problems.

The Eclipse Color Themes Plugin in Eclipse


The plugin attempts to do three things. First it is the one place, and page, where you can go to adjust your colors, no more 600 windows to search through to adjust that one color.   This alone is a time saver. The second thing it does is change your colors without side effects, that is, crashes and inter-plugin corruption. And lastly, it makes it easy to adjust your colors.

The Color Themes Plugin comes with quite a few color themes installed with the plugin. The "piece de resistance" though is that you can create your own color theme in a nice window on the web site. I created one called "geekgumbo," of course, which anyone is welcome to use. After creating your theme you download the XML file, not the epf file, to your computer, and then import it through the color theme plugin.

Creating your own theme on the Color Themes Web Site


The Color Themes configuration preferences in Eclipse are located at "Windows-> Preferences-> General-> Appearance-> Color Theme"  Click on Import a theme, find your custom theme you just downloaded, click "Apply," and presto your colors are your own without any nasty plugin conflict collisions.

Now, you've created your own color theme and you want to do what I like to do, tweak one color. You have a choice. You can do it on the web site, or on your computer. If you go to the web site, click the login link to the right of the page title, login, search for the name of your theme, click on the name of your theme, and your back to the color editor window. Change your colors, download the updated file, import it into the Color Themes plugin preferences in Eclipse, and your up and running.

Changing Theme Colors in Eclipse


There's an easier way to do this without going to the web site. The theme file is just an .xml file.  You did download the XML file, didn't you?  Go to the .xml file you downloaded, open it in Eclipse, and edit the colors there.  They will change right away without the download and import.  For those of you that are not sure what the hex color is, or what color you want, I highly recommend a small app called ColorCop, that I've been using for years, and love.  Have fun tweaking your colors.


Changing Eclipse Syntax Colors — 2 Comments

  1. Thanks a lot for this great article! I was struggling with black-on-black-text for 2 days now 🙁 Thanks to you I can be productive again! Thanks a lot 🙂