Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change location where eclipse create .eclipse, .p2, and other folders

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  
[email protected]/eclipse-workspace  
-XX:+UseG1GC  
-XX:+UseStringDeduplication  
--add-modules=ALL-SYSTEM  
-Dosgi.requiredJavaVersion=1.8  
-Xms256m  
-Xmx1024m  
--add-modules=ALL-SYSTEM 
like image 483
SGiux Avatar asked Oct 21 '17 17:10

SGiux


Video Answer


2 Answers

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
like image 180
aeportugal Avatar answered Oct 04 '22 17:10

aeportugal


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:

  • .eclipse
    • org.eclipse.epp.logging.aeri - Automated Error Reporting (AERI)
    • org.eclipse.equinox.security - secure storage for e. g. passwords
    • org.eclipse.oomph.* - see Window > Preferences: Oomph
    • org.eclipse.recommenders.models.rcp - Eclipse Code Recommenders
    • ...
  • .m2 - Maven repository used by M2Eclipse
  • .p2 - Equinox p2 (install/update subsystem)
  • .tooling - used by the Eclipse plug-ins for Gradle

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"
like image 39
howlger Avatar answered Oct 04 '22 17:10

howlger