CodyBugstein
CodyBugstein

Reputation: 23322

Where does Eclipse store preferences?

When I change a setting in a window like in the screenshot below, where are those settings actually stored?

Bonus: Is there any way, using Java, Eclipse RCP etc, to access the settings programmatically?

Thanks!

Eclipse Preferences

Upvotes: 57

Views: 90397

Answers (5)

Sridhar Sarnobat
Sridhar Sarnobat

Reputation: 25246

2024 update: org.eclipse.ui.workbench.prefs

myworkspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs

If I want to change the default text editor font on Mac OS to Monaco, I'd need something like this:

//org.eclipse.ui.commands/state/org.eclipse.ui.navigator.resources.nested.changeProjectPresentation/org.eclipse.ui.commands.radioState=false
ColorsAndFontsPreferencePage.expandedCategories=Torg.eclipse.ui.workbenchMisc
ColorsAndFontsPreferencePage.selectedElement=Forg.eclipse.jface.textfont
PLUGINS_NOT_ACTIVATED_ON_STARTUP=;org.eclipse.m2e.discovery;
eclipse.preferences.version=1
org.eclipse.compare.contentmergeviewer.TextMergeViewer=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.debug.ui.DetailPaneFont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.debug.ui.MemoryViewTableFont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.debug.ui.consoleFont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.egit.ui.CommitMessageEditorFont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.egit.ui.CommitMessageFont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.egit.ui.DiffHeadlineFont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.jdt.internal.ui.compare.JavaMergeViewer=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.jdt.internal.ui.compare.PropertiesFileMergeViewer=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.jdt.ui.PropertiesFileEditor.textfont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.jdt.ui.editors.textfont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.jface.textfont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.mylyn.wikitext.ui.presentation.textFont=1|Monaco|12.0|0|COCOA|1|Monaco;
org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_END=255,255,255
org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_BG_START=255,255,255
org.eclipse.ui.workbench.ACTIVE_NOFOCUS_TAB_TEXT_COLOR=16,16,16
org.eclipse.ui.workbench.ACTIVE_TAB_BG_END=255,255,255
org.eclipse.ui.workbench.ACTIVE_TAB_BG_START=230,230,230
org.eclipse.ui.workbench.INACTIVE_TAB_BG_END=255,255,255
org.eclipse.ui.workbench.INACTIVE_TAB_BG_START=240,240,240
preference.console.font=1|Monaco|12.0|0|COCOA|1|Monaco;
svn_comment_font=1|Monaco|12.0|0|COCOA|1|Monaco;
terminal.views.view.font.definition=1|Monaco|12.0|0|COCOA|1|Monaco;

Upvotes: 0

Optional
Optional

Reputation: 4507

Source : Eclipse wiki

If you want to keep preferences from one version to the other, export them using File/Export/Preferences.

Preferences are stored in various places (this applies to Eclipse 3.1)

for each installation (but this may vary for multi-user installations), in files stored in: <eclipse_home>/eclipse/configuration/.settings/

There is typically one file per plugin, with a prefs extension. Note that very few plug-ins use installation-wide preferences.

for each workspace, in files stored in <workspace>/.metadata/.plugins/org.eclipse.core.runtime/.settings .

There is typically one file per plugin, with a prefs extension. for each project --for project-level settings -- in files stored in a .settings sub-directory of your project folder.

Here's the article to access preferences using java code.

Upvotes: 55

KrisWebDev
KrisWebDev

Reputation: 9492

Search for it:

Change some setting in Eclipse then run:

find ~  -type f -mmin -5 | grep "\.settings"

This will discover files modified in last 5 minutes.

Mine was in workspace, literally...

~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.ui.workbench.prefs

Upvotes: 6

VonC
VonC

Reputation: 1324537

You can see most of the relevant eclipse settings (mainly for JDT) in the saneclipse project from Lars Vogel.

See the vogellacompany/com.vogella.saneclipse repo, which will tweak and fine-tune the settings of:

com.vogella.saneclipse.preferences/.settings/org.eclipse.jdt.core.prefs
com.vogella.saneclipse.preferences/.settings/org.eclipse.core.runtime.prefs
com.vogella.saneclipse.preferences/.settings/org.eclipse.core.resources.prefs
com.vogella.saneclipse.templates/.settings/org.eclipse.jdt.core.prefs
com.vogella.saneclipse.fileextensions/.settings/org.eclipse.jdt.core.prefs
com.vogella.saneclipse.fileextensions/.settings/org.eclipse.pde.core.prefs

Upvotes: 1

pellaton
pellaton

Reputation: 111

The preferences are stored in prefs files in the workspace at .metadata/.plugins/org.eclipse.core.runtime/.settings. There is one prefs-file for each plugin contributing preferences.

The programmatical access to the entire preferences is done with IPreferencesService the which you may obtain using Platform.getPreferencesService().

You may find more information and examples on how to use them in the Runtime preferences Eclipse help page.

Upvotes: 11

Related Questions