DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Debug Like a Pro in 2025: 10 New Eclipse Java Debugger Features to Enhance Your Productivity (With Spring Boot Examples)
  • Introducing Graph Concepts in Java With Eclipse JNoSQL, Part 3: Understanding Janus
  • Introducing Graph Concepts in Java With Eclipse JNoSQL, Part 2: Understanding Neo4j
  • Introducing Graph Concepts in Java With Eclipse JNoSQL

Trending

  • 5 Layers of Prompt Injection Defense You Can Wire Into Any Node.js App
  • LLM Integration in Enterprise Applications: A Practical Guide
  • You Are Using Claude Wrong (And So Is Everyone You Know)
  • Building AI-Powered Java Applications With Jakarta EE and LangChain4j
  1. DZone
  2. Coding
  3. Frameworks
  4. Eclipse Global Preferences

Eclipse Global Preferences

By 
Erich Styger user avatar
Erich Styger
·
May. 12, 12 · Interview
Likes (1)
Comment
Save
Tweet
Share
18.5K Views

Join the DZone community and get the full member experience.

Join For Free
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
recent_workspaces_protocol=3
max_recent_workspaces=10
show_workspace_selection_dialog=true
eclipse.preferences.version=1
recent_workspaces=c\:\\tmp\\wsp_test\nc\:\\tmp\\wsp_10.2

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:

-declipse.plugincustomization=cwide.properties

this tells eclipse to use the cwide.properties as a default configuration file. if i inspect that file, it has the following content:

org.eclipse.debug.ui/org.eclipse.debug.ui.switch_perspective_on_suspend=always
org.eclipse.debug.ui/org.eclipse.debug.ui.switch_to_perspective=always
org.eclipse.ui.editors/spellingengine=org.eclipse.cdt.internal.ui.text.spelling.cspellingengine

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 cwide.properties 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:

/instance/org.eclipse.ui.editors/tabwidth=2
/instance/org.eclipse.ui.editors/spacesfortabs=true

for the cwide.properties file i need to cut off the /instance/ part, so i have this added to the cwide.properties :

# set tab width to 2
org.eclipse.ui.editors/tabwidth=2
# using spaces for tabs
org.eclipse.ui.editors/spacesfortabs=true

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.

Eclipse Workspace

Published at DZone with permission of Erich Styger. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Debug Like a Pro in 2025: 10 New Eclipse Java Debugger Features to Enhance Your Productivity (With Spring Boot Examples)
  • Introducing Graph Concepts in Java With Eclipse JNoSQL, Part 3: Understanding Janus
  • Introducing Graph Concepts in Java With Eclipse JNoSQL, Part 2: Understanding Neo4j
  • Introducing Graph Concepts in Java With Eclipse JNoSQL

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook