I currently am trying to set up Eclipse to run from /opt/eclipse.
Everything was going fine; I extract the software using the Eclipse installer to /opt/eclipse; I made a soft link to it in my /usr/bin directory so I could just type 'eclipse' to run it from anywhere in my user terminal and I thought I was done until this happened:
$ eclipse /root/.p2/pool/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.400.v20160518-1444: cannot open shared object file: Permission denied Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
After some exploring in the /opt/eclipse/eclipse.ini and /opt/eclipse/configuration/config.ini files I came to the conclusion that when I installed Eclipse using the installer under super user permission that it installed the necessary libraries under /root directory.
I can use 'sudo eclipse' and it works but it becomes a hassle to have to enter my password every time. I am thinking of copying the .p2 file under /usr/lib to "generalize" it and allow access from any pwd as my user; would this be a smart idea or should I be doing something else?
Eclipse's p2 technology supports the concept of a bundle pool. Bundle pools help to dramatically reduce disk footprint and to eliminate repeated downloads of the same bundles and features, thereby dramatically improving the performance of software updates and target platform provisioning.
The . p2 folder is apparently for the Eclipse installer.
Multiple Eclipse windows, same workspaceTo open multiple Eclipse windows using the same workspace, select Window→ New Window. It's a good idea to use this technique if you want to work in two different perspectives (such as the Java and Debug perspectives) at the same time in different windows.
An agent is identified by its location on disk. Inside your Eclipse install you will see a p2/ folder, this is the agent for your IDE.
The .p2 folder is a shared installation folder that is referenced by all the Eclipse instances created by the installer. Sadly, I don't think it is safe to move the existing version (I might be wrong, but I am not sure how many times it is referenced), but you can create a new one.
The concept the installer is using here is called 'Bundle pool', and you can set up as many locations for that as you like. To open the bundle pool settings, find the corresponding item in the installer UI.
In case of the simple UI, press the menu bottom on the top (1), and then select Bundle pools...:
If you are using the advanced UI, there is an dropdown list at the bottom of the first page of the wizard with the list of existing bundle pools. By clicking the button next to it, you can get to the bundle pool manager.
In both cases, in the presented dialog you can create your own bundle pool which you can put into any folder you want and then use it as a source of installation.
Finally, if you have moved all your installations to this new pool, you can safely remove your original bundle pool folder, it will not be required anymore.
Say that I am user me
.
/opt/eclipse
with sudo chown -R me:me /etc/eclipse
so I can launch the envince-installer
without sudo rights. /opt/eclipse
in simple mode. No folder on /root/.p2
gets created. The .p2
tree is installed into my home directory (but as shown in the other answer you can customize this too) /etc/eclipse
with sudo chown -R root:root /etc/eclipse
. Now I can start the executable under /opt/eclipse
without sudo rights since there's no need to access /root
.My specifications: Ubuntu 14.04 LTS, Java SE Runtime Environment build 1.8.0_111-b14, Eclipse Installer 1.6.0 Build 2790, Eclipse Neon
I ran into the same issue (home directory was getting huge) and did a hack:
$ mv ~/.p2 /opt/eclipse/p2
$ ln -s /opt/eclipse/p2 ~/.p2
The eclipse installer (... and eclipse itself) seems happy with the symlink and the "pool" information now is hosted in the /opt/eclipse area and sucks up disk space over there.
You may have to get some superuser privs to do the first move, but it does work with open permissions and multiple users adding symlinks to the same area.
Having had the same type of problems, I think there should be more explanation on the actual installer. However, similar to the above, this is what I did to get an install that could be used by a non-root user, and store everything 'eclipse' the same place.
1) Clear up the mess created by initial experimentation:
2) Create the following folders:
Run the installer as sudo. Select Advanced install option on the GUI and add a new pool agent in the /opt/eclipse/pools folder. Select install folder to be /opt/eclipse/install. After installation delete any newly created folders '.p2', '.eclipse', 'eclipse' in /root.
The executable is now /opt/eclipse/install/eclipse/eclipse and can be started by a non-root user. Also, you can install new packages e.g. PyDev as a non-root user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With