Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 356406 - Eclipse forgets last workspace and does not show workspace prompt
Summary: Eclipse forgets last workspace and does not show workspace prompt
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows 7
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-31 16:38 EDT by Quinn Rohlf CLA
Modified: 2020-03-06 17:16 EST (History)
6 users (show)

See Also:


Attachments
zipped P2 repo with a minimal feature that reproduces the behaviour (4.14 KB, application/x-zip-compressed)
2012-06-29 06:13 EDT, Gerd Wütherich CLA
no flags Details
examples as plug-in projects (5.14 KB, application/x-zip-compressed)
2012-06-29 08:10 EDT, Gerd Wütherich CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quinn Rohlf CLA 2011-08-31 16:38:06 EDT
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.
Comment 1 Remy Suen CLA 2011-09-01 07:51:42 EDT
Perhaps you should try the steps a few times without installing CDT and see if CDT is triggering the problem.
Comment 2 Gerd Wütherich CLA 2012-06-29 06:12:05 EDT
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.
Comment 3 Gerd Wütherich CLA 2012-06-29 06:13:49 EDT
Created attachment 218071 [details]
zipped P2 repo with a minimal feature that reproduces the behaviour
Comment 4 Gerd Wütherich CLA 2012-06-29 08:10:02 EDT
Created attachment 218074 [details]
examples as plug-in projects
Comment 5 Gerd Wütherich CLA 2012-06-29 11:01:45 EDT
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.
Comment 6 Eclipse Genie CLA 2020-03-06 17:16:56 EST
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.