Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 33976 - [boot] default location of workspace
Summary: [boot] default location of workspace
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal with 1 vote (vote)
Target Milestone: 3.0 M9   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 5933 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-03-06 10:28 EST by DJ Houghton CLA
Modified: 2004-04-08 12:28 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description DJ Houghton CLA 2003-03-06 10:28:47 EST
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.
Comment 1 DJ Houghton CLA 2003-03-25 17:32:12 EST
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");
Comment 2 DJ Houghton CLA 2003-03-27 10:49:18 EST
*** Bug 5933 has been marked as a duplicate of this bug. ***
Comment 3 DJ Houghton CLA 2003-04-24 15:54:41 EDT
See also org.eclipse.core.launcher.Main.computeMetadataLocation.
Comment 4 DJ Houghton CLA 2003-07-21 14:20:39 EDT
and also Main.loadConfiguration
Comment 5 Sam Robb CLA 2003-10-21 16:47:39 EDT
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".
Comment 6 Mike Wilson CLA 2003-10-22 09:46:08 EDT
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.
Comment 7 DJ Houghton CLA 2004-04-08 12:28:56 EDT
Now when a user starts without specifying the "-data" option on the command
line, they will get the workspace chooser prompt.

Closing.