Where does Eclipse store preferences?
Asked Answered
C

5

57

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

Carbamate answered 2/7, 2013 at 17:27 Comment(1)
Check your workspace folder. There is this properties.properties file that can solve your curiosity and a .metadata folder as well.Thenceforward
S
55

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.

Shirring answered 2/7, 2013 at 17:36 Comment(3)
That article is from 2002, is it still relevant?Particularism
On the mac, the <eclipse_home> type path one is at: /Applications/Eclipse.app/Contents/Eclipse/configuration/.settingsThaine
If anyone reading this has enough rep for a 1-character edit, there is now an https version of the URL in the second link.Herzen
G
11

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.

Grandparent answered 2/7, 2013 at 17:42 Comment(0)
A
6

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
Anchoress answered 8/5, 2016 at 17:15 Comment(1)
Ah! This is a great way to find the change - thanksLeffert
E
1

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
Erg answered 8/12, 2014 at 7:45 Comment(0)
D
0

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;
Dortch answered 3/10 at 17:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.