Where do I download Eclipse?
At the time of this article, I downloaded Eclipse from this site:
https://eclipse.org/downloads/I downloaded the Linux 64 version of the “Eclipse IDE for Java EE Developers”.
Where should I install Eclipse?
If you are not familiar with the Linux directory layout, this article is recommended:
http://www.nixtutor.com/linux/understanding-the-linux-directory-layout/
The Eclipse IDE should be installed in the “opt” directory. Opt is reserved for additional software you install; although, most providers don’t use it. This is kind of like ‘Program Files’ for linux. My preferred path is:
/opt/eclipse/luna/.
This leaves opportunity to distinguish between JDK and JRE installations, and multiple versions of each.
How do I install Eclipse?
Typically, the file will be downloaded to your “downloads” folder in your home directory.
Using a terminal, following these steps:
sudo mkdir –p /opt/eclipse/luna/
tar -zxvf eclipse.XX.YY.tar.gz
sudo mv eclipse.XX.YY /opt
Optional: Put Eclipse in the Desktop Menu
Create a file called eclipse.desktop and place these lines inside:
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=env UBUNTU_MENUPROXY=0 eclipse44
Terminal=false
Icon=eclipse
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
And finally, run these commands:
sudo desktop-file-install eclipse.desktop
sudo ln -s /opt/eclipse/eclipse /usr/local/bin/eclipse44
sudo cp /opt/eclipse/luna/icon.xpm /usr/share/pixmaps/eclipse.xpm
sudo chown -R $USER:$USER /opt/eclipse/luna/configuration/
And now you should be able to run Eclipse!
Updating the PATH
Update the PATH variable with the working directory of your eclipse installation.
This will permit you to start eclipse from anywhere in the terminal by simply typing
eclipse
Open the /etc/environment file add this to the PATH variable:
sudo gedit /etc/environment
My updated file looks like this:PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:
/usr/lib/jvm/jdk/1.8.0_31/bin:/usr/lib/apache/maven/3.2.5/bin:/opt/eclipse/luna"
export JAVA_HOME=/usr/lib/jvm/jdk/1.8.0_31
export MAVEN_HOME=/usr/lib/apache/maven/3.2.5
export ECLIPSE_HOME=/opt/eclipse/luna
Modified portions of the file are in blue bold.