Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How modify Eclipse locations to prevent write to user.home directory?

I have tried all different settings, and yes, I m aware of eclipse.ini and config.ini and also tried different command line arguments! Nothing solved my problem!

All attempts and still each time I run eclipse.exe it wants write to my userhome i.e. the .eclipse and .p2 folders.

I have tried with all settings bellow among others, in different combinations too:

-Dosgi.user.area=file:/c:/eclipse-conf/e46
-Dosgi.configuration.area=file:/c:/eclipse-conf/e46
-Dosgi.instance.area=file:/c:/eclipse-conf/e46
-Declipse.p2.data.area=file:/c:/eclipse-conf/e46/p2
-Dorg.eclipse.equinox.p2.configurationFolder=file:/c:/eclipse-conf/e46/p2
-Dorg.eclipse.equinox.p2.installFolder=file:/c:/eclipse-conf/e46/p2
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=file:/c:/eclipse-conf/e46/p2
-Dorg.eclipse.equinox.p2.cache=file:/c:/eclipse-conf/e46/p2
-Dorg.eclipse.equinox.p2.roaming=file:/c:/eclipse-conf/e46/p2
-Dorg.eclipse.equinox.p2.cache.shared=file:/c:/eclipse-conf/e46/p2

This did not help! Well it writes to /e46 and /e46/p2 folder but it also creates/writes to c:\users\mrsimplemind\.eclipse & .eclipseextension & .p2 Even if I manually create the folders before it will not help.

Now please anyone here had success to fully isolate eclipse configuration output?

The only way I achieved this was by changing the user.home but I don't like this workaround as there are stuff in the original "user.home" that will be needed in eclipse, e.g. .ssh , .git , .m2 maven etc. I don't want to keep duplicates of profile settings for each eclipse user.home

I just want to isolate eclipse, this should be configurable! I don't like the outputs to user.home .. It is not an option! I want to have control of what eclipse creates in what folders, for each eclipse installation.

(I can only tell from windows os, I don't know how if Eclipse on Mac works better with the settings above)


I dont use OOMPH installer, some comments below are misleading

like image 805
MrSimpleMind Avatar asked Aug 26 '16 14:08

MrSimpleMind


2 Answers

As of Eclipse Java 2019-06 for Windows 10 64-bit

I added my eclipse.ini below:

-vmargs

-D"user.home=C:\your_path_here"

The 3 folders of .eclipse, .p2, & .tooling appeared after I started and then closed eclipse.

I am not sure when these are written into the new path, but it worked in my Windows 10.

like image 63
Ying Chiu Luk Avatar answered Jan 05 '23 02:01

Ying Chiu Luk


This works on Windows 7, Eclipse Oxygen:

  • Install Eclipse, but DON'T launch it yet
  • Edit eclipse.ini and, underneath -vmargs, add an entry to change user home to be a shared folder:

e.g.

-vmargs
-Duser.home=C:\Development
  • Launch Eclipse. Should see ".eclipse", ".tooling", etc folders created in shared folder, and nothing created under your user folder.
like image 40
David Lavender Avatar answered Jan 05 '23 02:01

David Lavender