Eclipse Global Preferences is brought to you in partnership with:

Erich is Professor at Lucerne University of Applied Sciences and Arts and Distinguished Member of Technical Staff at Freescale Semiconductor. Erich has a MsCS degree and 18+ years of experience in the embedded software and tools world. He created many embedded cross C/C++ compilers and debuggers. Additionally he is researching in the domain of programming languages, real time and mechatronic systems. Erich is a DZone MVB and is not an employee of DZone and has posted 130 posts at DZone. You can read more from them at their website. View Full User Profile

Eclipse Global Preferences

  • submit to reddit
      Rate This

Eclipse is good, but like any other tool: it gets better after I have it customized for my special needs. Eclipse stores a lot of settings in the workspace, see my article about Copy my workspace settings. But is there a way to apply some settings to every workspace? At least to the new ones? Because importing/exporting the settings can get really tedious as I have many workspace.  And indeed, there are global settings in eclipse. And I want to have them changed…

Warning: changing eclipse global preferences might break an eclipse installation. So better have a backup of the changed files at hand!

I’m using here the eclipse based CodeWarrior for MCU10.2, but things are pretty much the same for any eclipse based product (see the documentation in Defining your own global preferences).

Question: where are the global preferences stored? The first thing to check is the eclipse\configuration\.settings folder: Here some plugins store their global preferences. For example: the recent workspace settings are in org.eclipse.ui.ide.prefs.

#Fri Apr 06 16:46:14 CEST 2012

But what about all the other settings? Looking at the CodeWarrior installation, inside the eclipse folder, I find the cwide.ini file.

cwide.ini file

cwide.ini file

This file defines the eclipse startup options for launching the IDE (cwide.exe for CodeWarrior). The interesting part is this line:

This tells eclipse to use the as a default configuration file. If I inspect that file, it has the following content:


OK, that gives me an idea how settings could look like. But the question is: how to know the settings and syntax? What works (most of the time) is following approach:

  1. Launch eclipse with a new workspace
  2. Export the settings using File > Export > General > Preferences to a file
  3. Change the setting in Window > Preferences
  4. Export the settings using File > Export > General > Preferences  to a different file
  5. Compare/Inspect the exported information and find the settings
  6. Apply the settings to the file, without the /instance/ part
  7. Restart the IDE and check if it works with a new workspace

The last check is necessary as not all settings might work that way, see this forum post.

This is maybe best illustrated with an example. I have configured my workspace to use 2 for tab width and to insert spaces for tabs:

Changed Preferences for Tabs

Changed Preferences for Tabs

If I compare the two exported .epf files, this gives me:

Diffing Eclipse Preference Files

Diffing Eclipse Preference Files

That means the two following lines are configuring what I have changed:


For the file I need to cut off the /instance/ part, so I have this added to the

# Set tab width to 2
# Using spaces for tabs

Note: Preferences are applied in following order: global preferences, then local (workspace) preferences

This does NOT overwrite an existing setting of my workspace. As I can see from above diff, my initial workspace settings do not have any settings for tabWidth and spacesForTabs. Creating a new workspace use and apply my new settings. But once I have the them, they will not be overwritten with new global ones. Which makes sense: the local settings are winning.

Note: Post a comment if you know an elegant way how to enforce/overwrite workspace settings with global ones.

Published at DZone with permission of Erich Styger, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)