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!
This works on Windows 7, Eclipse Oxygen:
eclipse.ini
and, underneath -vmargs
, add an entry to change user home to be a shared folder:e.g.
-vmargs -Duser.home=C:\Development
Did you try adding the following line to eclipse.ini below -vmargs:
-Dosgi.configuration.area=@user.home/.someFolder
which will use .someFolder instead of .eclipse or
-Dosgi.configuration.area=C:\path_to_desired_location\.eclipseJAVA
The method I have tried to solve this problem has been nearly successful. Whether this is an answer for you will depend on your minimum acceptable level of quality.
I am posting this as a partial solution, perhaps in the hope someone else can build upon it to figure out a better workaround. Obviously the perfect solution would be if eclipse had a configurable download location and the installer actually installed all software to only the location selected, but that requires the Eclipse developers to fix the "P2" component of the product. What follows is only a workaround.
The premise is that the download pool folder always seems to be hardcoded into the config files to be under the home folder of the user that ran the eclipse installer. The essence of this workaround is to create a fake user home folder in the location of your choice, do a massive find-and-replace in the config files, and then force the Java system property to use that new folder as "user.home" which fools Eclipse into using it for its downloads.
This was tested on Eclipse 4.7 Oxygen.3A on Mint Linux.
Extensive brain surgery of the Eclipse installation folder is needed.
/media/LINAPPS/ubuntu-apps/eclipse-oxy
as the install target, which then creates /media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse
during the installation.eclipse-oxy/eclipse/fakeHome
cp -R /home/$USER/.p2 /media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse/fakeHome/.p2
eclipse
folder and edit the eclipse.ini
in a text editor. Make these 2 changes:
--launcher.library
to be the copy of the pool in the new location relative to the eclipse
folder, eg : fakeHome/.p2/pool/
...etc... -Duser.home=/media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse/fakeHome
eclipse/configuration/org.eclipse.update/platform.xml
. Find the first <site>
entry and change the url attribute to be the new pool folder relative to the eclipse folder. eg: url="file:fakeHome/.p2/pool/"
/media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info
and again find and replace all references to you user home's p2 folder with the new p2 folder under the fakeUser. You could find over 1000 matches to replace here. It again seems to be possible to make these relative to the eclipse folder, so a path of "fakeHome/.p2/pool/....." will work./eclipse/fakeHome/.p2
folder and edit both of the files there "pools.info" and "profiles.info". Again find any reference to your real user home and replace it with the path to the fakeUser folder. Use the full pathname (from root) for the pool location in both of these files.eclipse/fakeHome/.p2/org.eclipse.equinox.p2.engine/profileRegistry/_media_LINAPPS_ubuntu-apps_eclipse-oxy_eclipse.profile/
. Now find the latest timestamped gz file in that folder. For example it might be called "1529736854441.profile.gz".<property name='org.eclipse.equinox.p2.cache' value='/media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse/fakeHome/.p2/pool'/>
/eclipse/fakeHome/.p2/org.eclipse.equinox.p2.core/cache/artifacts.xml
and replaced the repository name with a reference to the new location inside fakeHome, but I am not sure this was necessary to get eclipse working.After doing the above, I tried to add Install New Software from the Help menu. After downloading lots of new plugins from Redhat and Spring, the new fakeHome pool occupies 900MB, but the original user home pool is still less than 400MB which is what it was as soon as eclipse had been installed. So it has been successful at moving the download cache of the updater and no files get updated in the old location, but two directories under .p2 still seem to have their timestamps touched.
If anyone finds this useful, or figures out how to improve it, please let me know.
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.