Where does Eclipse store settings and plugins in userdir? - eclipse

I've just installed a new Linux distro on my box and want to move my Eclipse home from the old /home/username/ to my new one. Because I changed the desktop, I don't want to copy all hidden folders from ~/. So which directories do I need copy in order to have all my installed plugins?
I've already copied ~/.eclipse/ and it definitely contains files related to the plugins but Eclipse won't load them. Any hints?

We've eventually found the directory containing all that stuff by accident. Somehow we broke it and Eclipse refused to start on my coworker's computer:-)
See ~/workspace/.metadata/.plugins or wherever your workspace resides.

As far as I know, Eclipse stores its plugins in its installation directory (eclipse). They might reside in eclipse/plugins or eclipse/dropins. You can copy the whole eclipse directory from your old box.

Related

Why is eclipse installing everything on my C drive?

I have limited space on my C drive, hence installing Eclipse in my E drive. After installation I find that about 1mb is on my E drive and all the rest is on my C drive!
Any idea how to get Eclipse to actually install in the folder I want? in previous versions all plugins went into the plugins folder of the install, but it seems Neon wants to install everything into a .p2 folder in my user folder.
Which is pretty useless too if I wanted Eclipse to be available to other users too...
thanks.
It appears that you downloaded the Windows installer version, which I would avoid if at all possible. While it is possible to tweak your installation to behave as expected, I suggest uninstalling it and downloaded the package of your choice from Eclipse Downloads. Unzip the package on your E: drive. The resulting eclipse directory will house all current files and plugins and others as you add/download them. The .p2 directory will still be created in your user directory, but will not contain anything other than some user-specific configuration information.
You can create a shortcut to eclipse.exe or on Windows 10 right-click and Pin to Start for easy reference. Also make sure that any workspaces you create are created someplace other than your user directory.

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
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.
If you are trying to prevent your Eclipse IDE from filling up your home drive, this technique will work (it has worked for me). It should not matter if Eclipse was installed by Oomph or from a plain zip, as nothing Oomph-related is modified in this solution.
If the requirement is that the user home p2 folder can be completely deleted and yet Eclipse still works without recreating that directory, no I have not been able to achieve that yet.
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.
Strategy
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.
Method
This was tested on Eclipse 4.7 Oxygen.3A on Mint Linux.
Extensive brain surgery of the Eclipse installation folder is needed.
Install Eclipse somewhere other than your user's home drive.
In this example the Oomph installer was given /media/LINAPPS/ubuntu-apps/eclipse-oxy as the install target, which then creates /media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse during the installation.
Start Eclipse at least once, then close it and make sure Eclipse is not running.
Create a new fake user home drive folder underneath the Eclipse folder.
In this example I created eclipse-oxy/eclipse/fakeHome
Copy the entire (hidden) p2 directory from your user home directory into the new fakeHome.
eg cp -R /home/$USER/.p2 /media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse/fakeHome/.p2
Go to the eclipse folder and edit the eclipse.ini in a text editor. Make these 2 changes:
set the line after --launcher.library to be the copy of the pool in the new location relative to the eclipse folder, eg : fakeHome/.p2/pool/...etc...
append a new system property setting to end of the file after all the other vm arguments, and set user.home to the new fake user home directory.
eg: -Duser.home=/media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse/fakeHome
Edit the file 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/"
Edit the file /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.
Go to the new /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.
Unpack, edit, and repack the latest profileRegistry. Find the folder
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".
gunzip that .gz file. Edit the .profile file and again replace any mention of your real user home with the new fakeUser folder. For example in my installation one of the first property settings had to be changed to
<property name='org.eclipse.equinox.p2.cache' value='/media/LINAPPS/ubuntu-apps/eclipse-oxy/eclipse/fakeHome/.p2/pool'/>
Delete the old gz file, then gzip the profile into a gz, so it has replaced the old one.
I also edited the file /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.
Start eclipse.
Results
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.
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.
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.
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

Manual Install of GWT 2.1.0 in Eclipse Helios 3.6.1

I am behind an intranet that does not have access to the download sites. Assuming I have access to all of the correct zip and jar files. What are the step by step instructions to get Eclipse to the point where I can go to Windows -> Preferences and see the Google entry?
1) I don't have access to the http://code.google.com/eclipse/docs/getting_started.html site because I am on a closed network.
2) I tried using the dropins folder and when I re-open Eclipse and go to Windows->Preferences "Google" isn't listed.
Any ideas?
The official zip-file installation instructions are at http://code.google.com/eclipse/docs/install-from-zip.html
This uses the Eclipse dropins mechanism, which helps Eclipse to pick up the new plugins in a clean way, quote:
... the dropins folder can be used much like the plugins directory was used in the past. A subtle twist on old behavior here is that plug-ins and features added to the dropins folder are properly installed into the system rather than being forced in.
Note:
Make sure, that you extract the zip file into the correct destination. It can easily happen, that it gets extracted e.g. into some subdirectory - so please check twice. You should have the following structure:
eclipse (this is your Eclipse installation folder)
dropins
eclipse (this is the directory created by extracting the zip file)
features
com.google.*
plugins
com.google.*
features
(your already installed features)
plugins
(your already installed plugins)
...
Then (re-)start Eclipse.
Just install the plugin from here and you are set to go.
http://code.google.com/eclipse/docs/getting_started.html
If you get a correct zip file for plugin, you will see "plugins" and "features" as soon as you open the zip file.
If your eclipse is in a location "c:\eclipse", extract the zip file into "c:\eclipse". The files will go into the corresponding folders.
Drop them in the plugins folder

Backup Eclipse plugins and settings

I'm using Eclipse and have plenty of plugins installed and configured to my needs. Is there any good way to backup these plugins and the configuration of them. I want to be able to replay these plugins in futures eclipse version (as long as they are compatible) and on different PCs.
I know I could simply archive the whole eclipse/ folder, but I find this a little inelegant.
There are two parts to your question:
Copying your settings between Eclipse installs
Copying your installed plugins between Eclipse installs
#1 is easy to do. You can export your Eclipse preferences from the File -> Export... -> Preferences. The resulting file contains all of your preferences for each installed plugin. It is portable between Eclipse installs and versions.
#2 is not really the "Eclipse" way of doing things. It is possible, but you need to structure your installed plugins differently. Rather than using the standard update manager to install your plugins, you can use the dropins folder. What you need to do is to copy every feature and plugin that you want to be shared across multiple installs into a zip file with the following structure:
eclipse/
features/
plugins/
Then you can unzip the file into the dropins folder of all the Eclipses that you want.
More information on dropins:
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/p2_dropins_format.html
P2 installation replication is a tool to help you backup installed plug-ins, you could install it via Eclipse Marketplace.
According to the settings of configuration, most of them are persisted in your workspace. So you could backup your workspace/.metadata folder.
While inelegant, archiving the entire eclipse folder is also insufficient. I think you want to archive the following:
The entire eclipse installation folder.
The .metadata folder of every workspace.
By doing this, you will not only preserve the plugins and their settings, but you will also preserve an eclipse installation in which you know your plugins work.
I've made small service for myself to synchronize Eclipse settings. Currently it supports Java Templates + Bash Aliases. Could be useful for someone else.
http://confsync.com

How to delete Eclipse completely (including settings and plugins) from Mac OS X?

My Eclipse with GAE broken and works strangely.
So I deleted Eclipse from Application folder, but there is garbage left. I re-downloaded fresh new eclipse, but it runs with old settings, and broken GAE structure remained.
How can I DELETE completely Eclipse from my Mac? (without any kind of settings/plugins/logs etc.)
Eclipse itself will be installed where you've unzipped the file you've downloaded. This directory contains Eclipse.app, configuration/, plugins/ and features/ (amongst others).
Your workspace/ directory (in your home directory by default) contains all your projects and various settings too, in workspace/.metadata/ (see dot files if you want to have a look). Deleting the workspace will delete your own project files of course, so you would need to make sure you have a way to restore them from a clean version (for example from a version control system if you're using one).
If you don't want to delete your entire workspace, it might be worth moving it away and then copying the projects back in, leaving the new workspace/.metadata/ clean, to see if this fixes your problem.
Add ~/Library/Caches/org.eclipse.platform.ide to the list
Im not sure if this is the right place for such kind of questions...But r u using any applications such as "app cleaner"?
if not try it... http://en.softonic.com/s/app-remover:mac