Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
777 views
in Technique[技术] by (71.8m points)

macos - Eclipse opens blank workspace

I have this weird issue where the following happens:

  • fresh eclipse juno install (with all updates applied)
  • works fine for a while asking which workspace I want to open with a dialog on startup
  • after a few days it stops prompting me for workspace, opens blank made up workspace instead in /Users/myself/Documents

If I check "preferences -> workspace -> startup and shutdown" everything seems fine, the only workspace in the list is the one I created and the checkbox that says "don't prompt for workspace" is not checked.

This happened a few times already on fresh eclipse installations and fresh hard drives (same machine but I replaced the hard drive, re-installed OS and everything for other reasons and now it happened again).

I am on:

  • OSX 10.7.5
  • Eclipse Juno (Service release 2)

Any help appreciated!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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):

  1. Goto your Eclipse directory where you run Eclipse from (mine is /Applications/eclipse)
  2. In {eclipse_dir}/configuration open the file config.ini
  3. Find the line [email protected]/... and confirm that it is pointing to the bogus workspace directory.
  4. Modify the path of this entry to point to the correct workspace
  5. Save the config.ini file.
  6. Try starting Eclipse and it should open your workspace now.
  7. 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.
  8. 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!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...