How to change the Eclipse default workspace?

Where can I change the default workspace in Eclipse?


If you mean "change workspace" go to File -> Switch Workspace


I took this question to mean how can you change the Default workspace so that when Eclipse boots up the workspace you want is automatically loaded:

  • Go under preferences then type "workspace" in the search box provided to filter the list. Alternatively you can go to General>Startup and Shutdown>Workspaces.
  • There you can set a flag to make Eclipse prompt you to select a workspace at startup by checking the "Prompt for workspace at startup" checkbox.
  • You can set the number of previous workspaces to remember also. Finally there is a list of recent workspaces. If you just remove all but the one you want Eclipse will automatically startup with that workspace.

  1. Go to eclipse\configuration\
  2. Open the file "config.ini"
  3. Modify the line

    osgi.instance.area.default="F:/Workspace/Java"
    

    where "F:/Workspace/Java" should be your default workspace!


If you are talking about changing the working directory for a java program that you launch from within eclipse, then there's a space for that in the run configuration. If you go to Run menu and select "Run Configurations..." then select your run configuration, then on the "Arguments" tab for a Java Application there is a place for you to edit the "Working directory". This alters the current directory that will be used for launching the java program.

See related question Default eclipse working directory if this is what you are meaning.


Whatever Frank has suggested to change in config.ini is correct. In case, if that didn't help, you need to remove path from recent workspace as below.

  1. Go to eclipse\configuration\org.eclipse.ui.ide.prefs\
  2. Open the file "org.eclipse.ui.ide.prefs"
  3. Remove the first path in RECENT_WORKSPACES.

    MAX_RECENT_WORKSPACES=5 RECENT_WORKSPACES=/Users/wrokspace1\n/Users/wrokspace2\n/Users/wrokspace3\n/Users/wrokspace4 RECENT_WORKSPACES_PROTOCOL=3
    SHOW_WORKSPACE_SELECTION_DIALOG=false
    eclipse.preferences.version=1