I have exactly the same problem on OSX, for no reason, one fine day, Eclipse will start-up with a new blank workspace!
And to all the stupid answers and responders out there: YES I know how to set and select a default workspace! And NO creating a new workspace, re-importing lots of projects and loosing all my 30+ database connections under my Toad Extension, is not an option.
What I found is that
- For some reason Eclipse creates a directory
/Users/user_name/Documents/workspace
which is the blank workspace it starts-up with (incorrectly)
- My usual workspace is under
/Users/user_name/Documents/Development/eclipse
The solution is (this is on Mac OSX, don't know if it is the same on Windows):
- Goto your Eclipse directory where you run Eclipse from (mine is
/Applications/eclipse
)
- In
{eclipse_dir}/configuration
open the file config.ini
- Find the line
osgi.instance.area.default=@user.home/...
and confirm that it is pointing to the bogus workspace directory.
- Modify the path of this entry to point to the correct workspace
- Save the
config.ini
file.
- Try starting Eclipse and it should open your workspace now.
- If your Eclipse get stuck loading plugins now, goto your workspace directory and look for the
.metadata
directory (its hidden). Inside the .metadata
directory, remove the .mylyn
directory and restart Eclipse.
- Once Eclipse started with the correct workspace loaded, do a proper Eclipse shutdown to ensure your workspace is closed and saved properly.
This worked for Eclipse Juno.
Hope this helps!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…