Community
Participate
Working Groups
Part of the effort to improve the out-of-box experience of Eclipse. Currently if the user does not specify the location of their workspace via the "-data" command-line argument, then we use the System property "user.dir". A common setup scenerio on Linux platforms would be for the root user to install Eclipse to /usr/local and then for the users to try and start. In this case, they will most likely not have write permissions to the directory where Eclipse is installed and will fail the first time starting up. Investigate using the System property "user.home" as the default workspace location. It is important to check this against multiple operating systems and methods of starting up. For instance, on Win32 it is common for people to edit the "Start in..." property of their Eclispe shortcut.
InternalBootloader.initialize() contains the code which calculates the default location for the workspace. Change might be as simple as first checking to see if there is a workspace at the old default location (user.dir) and if not then using the new default location (user.home). Something like: file = System.getProperty("user.dir"); if (!file.exists()) file = System.getProperty("user.home");
*** Bug 5933 has been marked as a duplicate of this bug. ***
See also org.eclipse.core.launcher.Main.computeMetadataLocation.
and also Main.loadConfiguration
If you are interested, we have a patch for the launcher source that sets the default workspace in the launcher. Build platform determines the environment variable used for selecting the default directory ("USERPROFILE" under Windows, "HOME" for other systems). For us, rebuilding the launcher to pass the desired -data argument was more strightforward than patching Eclipse to change the way it determined the default workspace directory. In particular, it made it much easier to implement workspace branding; our default directory is not "workspace", but "TimeStorm-workspace".
If you are interested in releasing the patch as open source (under CPL) you can attach it to this PR. We'd definately like to see it.
Now when a user starts without specifying the "-data" option on the command line, they will get the workspace chooser prompt. Closing.