Community
Participate
Working Groups
Build Identifier: I20110613-1736 I have a problem where my Eclipse install consistently forgets the last workspace used and refuses to show a workspace prompt on startup. Instead, it always opens with the workspace set to %userprofile%/workspace. I have tried deleting my old eclipse install and getting a fresh copy of eclipse, but soon after I finished installing it and the CDT, I started having the same issue. This leads me to believe that the source of the bug is one of my workspaces. My next step will be to delete/reinstall eclipse and my workspace and see if that fixes anything. Reproducible: Always Steps to Reproduce: 1. Extract Eclipse Classic x64 (windows) 2. Run Eclipse as administrator. Install Eclipse CDT. 3. Point Eclipse at an existing workspace (other than %userprofile%/workspace) 4. Exit Eclipse 5. Open Eclipse 6. No workspace prompt is shown, Eclipse will always open or create a workspace in %userprofile%/workspace despite having had a different workspace open previously.
Perhaps you should try the steps a few times without installing CDT and see if CDT is triggering the problem.
The described behaviour occurs if you access the ResourcesPlugin to early (probably before the -data parameter has been passed in). The attached example contains a P2 repository with a minimal feature that contains a minimal bundle. After installing the feature and restarting the eclipse IDE, eclipse 'forgets' the last workspace location and opens (or recreates) a workspace in the default location. Uninstalling the feature cures the disease.
Created attachment 218071 [details] zipped P2 repo with a minimal feature that reproduces the behaviour
Created attachment 218074 [details] examples as plug-in projects
After some further investigations I found the following explanation: In my example the bundle is automatically started with the OSGi frameworks (I added a small p2.inf file in the META-INF folder of my plug-in project to force the P2 repo metadata generator to generate an corresponding entry in the P2 metadata). Within the bundle's activator I (maybe transitively) access ResourcesPlugin.getWorkspace(). At this time the eclipse application (extension point 'org.eclipse.core.runtime.applications' has *not* been started. So the -data parameter has not been set and as the result the call ResourcesPlugin.getWorkspace() creates a (maybe new) default workspace.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.