Where does Eclipse store the information regarding "Run Favorites" or "Debug Favorites"?
1 Answers
These are stored in the file launchConfigurationHistory.xml
in the workspace .metadata/.plugins/org.eclipse.debug.ui
directory.
The file contains various launch related settings, favorites are in the <favorites>
sections.
Note: It is probably not safe to modify this file while Eclipse is running.
Update:
The launch configuration file itself name.launch
in the .metadata/.plugins/org.eclipse.debug.core/.launches
directory is also updated to say which favorites group it is in.
Update:
If a xxx.launch file is in a favorites group it contains something like:
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute>
(along with lots of other launch related entries)
Update:
You can look at the launch configurations in a plugin using:
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfiguration [] configs = manager.getLaunchConfigurations();
The IDebugUIConstants.ATTR_FAVORITE_GROUPS
attribute of the ILaunchConfiguration
should contain any favorites groups the launch is in.

- 109,219
- 232
- 102
- 145
-
Hi, grrg, for the first directory you mentioned in your post, I can find the settings related to favorites. However, for .metadata/.plugins/org.eclipse.debug.core/.launches, I couldn't find the any settings related to "favorites" – chygo Apr 05 '14 at 15:59
-
Added the contents of the xxx.launch file if it is in a favorites list to the answer – greg-449 Apr 05 '14 at 16:51
-
Hi, greg, thank you for your previous answers. I have done some test about the launchConfigurationHistory.xml file. And I realise that the changes that I made about the "Run Favorites" wouldn't be saved to the file until I close the workspace or the Eclipse. Is there anyway to get the runtime data about the "Run Favorites"? – chygo Apr 07 '14 at 14:00
-
Added how to access launch configuration from a plugin – greg-449 Apr 07 '14 at 14:11
-
Hi Greg, I have tried your method in my plugin. "ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();" However, the line of code didn't work. When I debug the application, the executor goes directly to the method sendEvent (Event event) in the EventTable.class (I put the code in a button even handler). – chygo Apr 17 '14 at 14:08