15

I see that eclipse create in my user home folder some folders like .eclipse .p2 etc... I want change this default folder(I want save all in a D: location.). I read this Change .eclipse folder in Linux but I don't understood which file .ini I must change and if I do this before on after eclipse installation. Furthermore I have Windows 10 not Linux. Sorry for my English. I hope in your help.

This is my eclipse.ini

-data  
D:/Programmi/Eclipse  
-configuration  
D:/Programmi/Eclipse/eclipse `  
-startup  
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar  
--launcher.library    
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.550.v20170928-1359  
-product  
org.eclipse.epp.package.java.product  
-showsplash  
org.eclipse.epp.package.common  
--launcher.defaultAction  
openFile  
--launcher.defaultAction  
openFile  
--launcher.appendVmargs  
-vmargs  
-D"user.home=D:/Programmi/Eclipse/home"
-Dosgi.requiredJavaVersion=1.8  
-Dosgi.instance.area.default=@user.home/eclipse-workspace  
-XX:+UseG1GC  
-XX:+UseStringDeduplication  
--add-modules=ALL-SYSTEM  
-Dosgi.requiredJavaVersion=1.8  
-Xms256m  
-Xmx1024m  
--add-modules=ALL-SYSTEM 
SGiux
  • 619
  • 3
  • 10
  • 34
  • 1
    Install Eclipse and before running it edit `eclipse.ini`. I recommend to set [`-data` and `-configuration`](https://help.eclipse.org/oxygen/topic/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html) (add 4 additional lines at the beginning of `eclipse.ini`: first line: `-data`, second line: workspace directory, third line: `-configuration`, fourth line: configuration directory; by default the `.p2` directory will be created in the parent directory of the configuration directory). – howlger Oct 21 '17 at 21:32
  • When run eclipse I have again three folder .eclipse .p2 .tooling. – SGiux Oct 22 '17 at 08:31
  • Do you use Eclipse Installer or did you unzip a package? Where are the folders actually located and where do you expect them to be? – howlger Oct 22 '17 at 08:36
  • Unzip. The folder is located in C:\Users\\[userhome] and I Want move in D:\Programmi\Eclipse. – SGiux Oct 22 '17 at 11:56
  • **Already asked and more details are given here**: [modify eclipse locations...](https://stackoverflow.com/questions/39168906/how-modify-eclipse-locations-to-prevent-write-to-user-home-directory) – MrSimpleMind Nov 09 '17 at 12:22

2 Answers2

7

An easy way to do something similar is to move the directory to a desired location and then create a symbolic link to user directory.

Example: The new .p2 location is D:\Programmi\Eclipse\.p2

Open CMD console as Administrator and execute the following:

mklink /D C:\Users\your-user\.p2 D:\Programmi\Eclipse\.p2
aeportugal
  • 201
  • 5
  • 9
6

Some Eclipse plug-ins store data that are intended to be used by multiple Eclipse installations in subdirectories of your home directory. For example, the Eclipse IDE for Java Developers uses following directories:

Additional plug-ins might or might not use additional directories to store data.

The trick is to set the home directory used by Java/Eclipse by adding the following line after the line -vmargs to your eclipse.ini:

-D"user.home=D:/Programmi/Eclipse/home"
howlger
  • 31,050
  • 11
  • 59
  • 99
  • 1
    I add this line but don't work. When run eclipse create .p2 and .eclipse folder in user path – SGiux Oct 25 '17 at 21:07
  • It worked for me on Windows 10 with Eclipse Oxygen.1a. Is `.p2` the only subdirectory that is created in your home directory? What does it contain? – howlger Oct 26 '17 at 07:20
  • I both path D:/programmi/Eclipse/home and user path I have .p2 and .eclipse folder but also .tooling folder. The .p2 folder in home directory contain 2 file .info and two folder .core and .engine – SGiux Oct 26 '17 at 16:26
  • After adding `-D"user.home=D:/Programmi/Eclipse/home"` and before starting Eclipse, did you delete the configuration area (`-configuration`) and the workspace (`-data`)? It might be that there were paths stored to your home directory in it. – howlger Oct 26 '17 at 18:25
  • 1
    Worked for me, but WITHOUT the quotes, and with different slashes: `-Duser.home=C:\Development`. Eclipse Oxygen. – David Lavender Jul 11 '18 at 13:23