Move default config folder of eclipse

后端 未结 5 1929
醉话见心
醉话见心 2020-12-16 14:51

When Eclipse first start, it creates some config files and folders on my hard drive (contains information about work-space ...etc...). I don\'t like the position it creates

相关标签:
5条回答
  • 2020-12-16 15:16

    Just add the following to your eclipse.ini file (found at the root eclipse installation folder):

    -Dosgi.configuration.area=file:/C:/Workspace/.eclipse 
    
    0 讨论(0)
  • 2020-12-16 15:19

    As other said, adding the property -Dosgi.configuration.area in the eclipse.ini file does the trick.

    But in my opinion it would be better to rely on the user.home variable and set the destination like for the other variables.

    Example with -Dosgi.instance.area.default:

    -Dosgi.instance.area.default=@user.home/eclipse-workspace
    

    In my case I just wanted another destination than the default @user.home/.eclipse which was used by the Eclipse Mars I still uses for old project and I defined:

    -Dosgi.configuration.area=@user.home/.eclipse-oygen-3
    

    to have a specific destination for Eclipse Oxygen 3 installation.

    Note that syntax works for both Windows and Linux (I did not tested on OSX, but I guess it should).

    0 讨论(0)
  • 2020-12-16 15:29

    IMHO parameter -configuration does the trick. It must point to a subdirectory named "config". Eclipse will fill this and the upper directory itself with files, e.g. for a JBoss server installation.

    If you have more than one eclipse installation, then you should use a different directory for each eclipse installation.

    Example how to keep everything in defined places:

    "C:\Program Files (x86)\eclipse\eclipse48jee\eclipse.exe" -nl en_US -vm "C:\Program Files (x86)\Java\jdk1.8.0_212\bin" -configuration C:\EclipseData\eclipse48jee\config -data C:\Workspaces\SomeProject

    0 讨论(0)
  • 2020-12-16 15:35

    To change the default .eclipse folder location, go to ${eclipse.home}, open your eclipse.ini with a text editor and insert there one line more:

    -Dosgi.configuration.area=/path_to_new_folder_location/.eclipse/

    0 讨论(0)
  • 2020-12-16 15:36

    Eclipse has some command line arguments you can use. One of those arguments is the flag -data which tells Eclipse where the workspace of Eclipse should be located.

    So when I create a new workspace, I normally create a shortcut under Windows (or script file under Linux) with the following contents:

    eclipse.exe -vm <JDK>\bin\javaw.exe" -data ws -nl en
    

    This defines which JDK should be used, that the workspace is located under ws and that the english locale should be used.

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