94

I noticed that after installing cdt, Eclipse always loads the default workspace. The workspace listed in the config.ini in osgi.instance.area.default. Eclipse does not ask which workspace to open regardless if Prompt for workspace on startup is set or not.

How do I force Eclipse to ask which workspace to load on startup?

Richard Povinelli
  • 1,419
  • 1
  • 14
  • 28
michael nesterenko
  • 14,222
  • 25
  • 114
  • 182

19 Answers19

114

It works for me if I tick the box Prompt for workspace on startup, which you can find in Window → Preferences → General → Startup and Shutdown → Workspaces.

Andreas
  • 2,694
  • 2
  • 21
  • 33
112

I had the same problem with indigo on linux 3.0 X86_64: After runnning eclipse -clean everything went back to normal.

Thanks to some comment on the eclipse issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=134412

fasseg
  • 17,504
  • 8
  • 62
  • 73
  • I will try once I get to that problematic eclipse – michael nesterenko Sep 14 '11 at 13:33
  • 3
    For OSX, I had to type: `$ PATH_TO_ECLIPSE/Eclipse.app/Contents/MacOS/eclipse -clean` and it worked. – DustinB Jan 17 '13 at 16:59
  • 4
    @Amit: That did not work for me when I had the problem with my workspace. The tick would just be ignored by eclipse... – fasseg Apr 10 '13 at 07:46
  • Now two cases may happen if 1. you didn't click the eclipse button or 2. If u installed eclipse as root and now u are trying to alter its properties in non root instance... – Amit Apr 10 '13 at 12:02
  • start eclipse, Window->Preference-> type "workspace" in the search box. click workspaces then tick the box with "promote workspaces when start up" – Junchen Liu May 13 '13 at 08:52
  • 1
    Thanks! I needed to -clean -- after searching I found that this indeed just cleans certain _caches_ out, so it's totally safe. – arantius Sep 10 '13 at 23:27
  • This worked for me on a Windows installation. Eclipse stopped asking for the workspace, despite the preference, after eclipse crashed. Might be worth doing a clean after any crash as other, less visible settings may be altered or corrupt somehow. – lilbyrdie Sep 19 '13 at 18:33
  • 1
    -clean doesn't work for me on Mac. The problem started after I installed EGit, ADT and ADT Translation Manager. – Monstieur Nov 28 '13 at 14:17
  • This still happens on the last eclipse Mars. The command solved it, thanks! – IvanRF Sep 01 '15 at 16:32
  • @IvanRF: what command solved it for you? Are you referring to -clean? I have an RCP app built on Luna, and nothing I do makes the workspace location prompt appear on startup. – MidnightJava Sep 02 '15 at 18:53
  • @MidnightJava Yes, I used `eclipse -clean`, the prompt was restored and I could set my default workspace. – IvanRF Sep 02 '15 at 19:12
35

Inside the configuration/.settings folder of your Eclipse installation, there is a file called org.eclipse.ui.ide.prefs. Open this file in a text editor and change the property SHOW_WORKSPACE_SELECTION_DIALOG from false to true.

Tested with Eclipse 3.7 on Windows.

Robert Taylor
  • 642
  • 5
  • 13
  • I am having this problem (under Linux) and the property is already set to true. – Eponymous Jun 13 '12 at 15:29
  • I tried this on Ubuntu 11.10/Eclipse 3.7 and it worked. What version(s) are you using? – Robert Taylor Jun 24 '12 at 09:34
  • At the time I was using Fedora 14 (I don't remember which version of Eclipse, sorry). I have since switched to Ubuntu and everything works nicely. – Eponymous Aug 14 '12 at 14:44
  • It is true but doesn't help. (Ubuntu 12.04, Eclipse Juno) – Bevor Aug 14 '12 at 20:17
  • This is what worked for me. I had switched to a workspace that made Eclipse hang. I couldn't get to “Prompt for workspace at startup” therefore. – Jack Holt Aug 22 '12 at 20:56
  • This worked for me in an environment where eclipse hung due to a corrupt workspace and I needed the prompt to choose another workspace, the command line arguments provided in the thread had no effect. (Eclipse Version: 3.7.2 x64-bit, Windows 7) – Matt Jones Jan 13 '14 at 06:05
  • This solution still works with Eclipse Mars 2. Thanks ! – Linh Lino Jun 29 '16 at 07:08
26

Using Eclipse Indigo this is how I did it:

Window → Preferences → Startup and Shutdown → Workspaces

Check the box at the top of the window that says "Prompt for workspace on startup"

Michael Szczepaniak
  • 1,970
  • 26
  • 35
4

Version: Eclipse CIndigo Service Release 2

  1. File > Switch Workspace > Other...
  2. In the textbox, write the path in the Workspace or Browse

It automatically sets the default Workspace during exit.

sacrilege
  • 41
  • 2
4

The “Prompt for workspace at startup” checkbox did not working. You can setting default workspace, Look for the folder named “configuration” in the Eclipse installation directory, and open up the “config.ini” file. You’ll edit the "osgi.instance.area.default" to supply your desired default workspace.

Yongju
  • 41
  • 2
3

I followed the thread and tired all things but didn't work. Finally I saw that my eclipse shortcut target is like below

C:\Eclipse_3.6\eclipse\eclipse.exe -clean -data "C:\workplace" ...

I simply removed -data option and it worked. Now I got popup to choose workspace at startup.

cheers.

kleopatra
  • 51,061
  • 28
  • 99
  • 211
ashah
  • 169
  • 2
  • 12
3

Starting eclipse with eclipse -clean did wonders for me.

AllBlackt
  • 710
  • 6
  • 9
3

I had the same issue (in Eclipse Juno), but I just wanted to change the default workspace to the one I'm using

There's a setting in ECLIPSE_DIRECTORY/configuration/config.ini that is causing a specific workspace to be loaded without prompting for a workspace. If you just want to change the default workspace, you can just modify the value or add it if it doesn't exist:

osgi.instance.area.default=@user.home/some_workspace

or

osgi.instance.area.default=/some/absolute/path/some_workspace
11101101b
  • 7,679
  • 2
  • 42
  • 52
1

Under Aptana 3.2.2, in \configuration\.settings\org.eclipse.ui.ide.prefs, edit:

RECENT_WORKSPACES=I\:\\PDT\\workspace

It will check the recent workspace, so just set it to what you want. I do it for running off an external drive.

Phil Jackson
  • 10,238
  • 23
  • 96
  • 130
  • This is the fix I was looking for. I propose this as the best low-level answer, especially if Eclipse won't start due to corruption. – radsdau Aug 31 '16 at 01:28
1

I can confirm that I am having the same issue. I am also using Eclipse classic with CDT. The funny thing is that it only started happening earlier this evening. Before then, I was always prompted for the workspace. Checking Prompt for workspace on startup has no effect. I am not launching eclipse using a startup script, so the -data flag is not set on launch. I have removed the line osgi.instance.area.default from the configuration/config.ini file, but that had no effect.

A few strange quirks that are incidental to this problem: If I delete the workspace workspace it creates it again upon launch. However, when I switch to one of my "real" workspaces I notice that the workspace workspace is not listed as an option to be switched to.

As would be expected, reinstalling Eclipse resolves the issue. But it would be nicer to find a way to fix the problem without resorting to that.

Jim Kaiser
  • 11
  • 2
  • reinstalling helps? heh, would probably try to install cdt on fresh eclipse copy, but in that case this problem should be with other plugins – michael nesterenko Sep 14 '11 at 13:38
  • I was having the problem and I never installed the CDT, so I think installing the CDT is a red-herring. As with Jim Kaiser, none of the other solutions fixed my problem. But reinstalling a fresh Eclipse (J-EE in my case) fixed the problem. – Eponymous Jun 13 '12 at 15:50
0

I had the same problem on my Eclipse, and calling eclipse -clean did not solve the problem.

In the end I figured out that within the installation folder of Eclipse there is a script called eclipse. This script does some setting of environment variables and then calls eclipse.bin. The call for eclipse.bin contained the this command-line switch:

-data ~/.eclipse

When I removed that switch from start-up script, I got the workspace selection as expected.

0

Editing the config.ini file with

osgi.instance.area.default=\D:\\Projects\\Eclipse Workspace\\

worked for me.

arulmr
  • 8,620
  • 9
  • 54
  • 69
J-Phi
  • 1
0

I first tried the -clean option, but that didn't solve the problem. Then I added the -data option with the correct path to the workspace, which worked.

Arjen Rodenhuis
  • 199
  • 1
  • 3
0

I resolved the problem by adding the -showLocation flag to eclipse.ini.

0

Sometimes you need to pay attention to howw Eclipse is launched. I ever pinned Eclipse by rigk-click on the excutable and pinning it to taskbar. In this way, the Eclipse is launched to use settings under c:\User\public\public Documents\eclipse" which is not very desirable.

However, if you pin it by creating a short-cut, then it will launch to use settings in the folder of Eclipse installation. Then everything makes much more sense.

CCNA
  • 388
  • 7
  • 17
0

If your Eclipse is auto-closing at startup you can

  • Open the properties of your shortcut and add -clean at the end of the path,
  • Or, in a command prompt, run C:\PATH_TO_YOUR_ECLIPSE\eclipse -clean like mentioned in the comments and other answers
0

I'd recommend you to create a shortcut to eclipse.exe with the -data command line option. This way you can create a separate shortcut to each workspace you use, and avoid unnecessary dialogs and mouse clicks.

Windows: Just create an Eclipse shortcut on your desktop, then right-click to open Properties and under Shortcut set something like this as Target: C:\eclipse\eclipse.exe -data C:\Path\to\your\workspace1. This will launch Eclipse and automatically open workspace1.

Repeat the steps for all the workspaces you use often.

Danijel
  • 8,198
  • 18
  • 69
  • 133
0

Go to Window → Preferences → General → Startup and Shutdown → Workspaces (or Eclipse → Preferences → ... on macOS)

Check the checkbox Prompt for workspace on startup

Then at startup Eclipse will ask for workspace selection.

Srikanth Venkatesh
  • 2,812
  • 1
  • 20
  • 13