How to force Eclipse to ask for default workspace?

后端 未结 19 1747
夕颜
夕颜 2020-12-02 10:08

I noticed that after installing cdt, Eclipse always loads the default workspace. The workspace listed in the config.ini in osgi.instance.area.default

相关标签:
19条回答
  • 2020-12-02 10:57

    I had the same issue (in Eclipse Juno), but I just wanted to change the default workspace to the one I'm using. There is 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

    0 讨论(0)
  • 2020-12-02 10:57

    if your eclipse is auto-closing at startup you may do this: open the properties of your shortcut and add -clean at the end of the path. or do this in cmd : cd C:\PATH_TO_YOUR_ECLIPSE\eclipse -clean like mentioned earlier above comments

    0 讨论(0)
  • 2020-12-02 10:59

    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 command line switch

    -data ~/.eclipse
    

    When I removed that switch from start-up script, I got the workspace selection as expected. Maybe that helps others to solve their problems.

    0 讨论(0)
  • 2020-12-02 10:59

    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.

    0 讨论(0)
  • 2020-12-02 11:01

    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, 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.

    0 讨论(0)
  • 2020-12-02 11:02

    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.

    0 讨论(0)
提交回复
热议问题