Monday, February 2, 2015

Installing Eclipse on Ubuntu

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.


Reference:

  1. [Github] Installation Script (based on this article)
  2. [Blogger] Installing Oracle's JDK on Ubuntu 14.04
  3. http://askubuntu.com/questions/26632/how-to-install-eclipse
  4. http://ubuntuhandbook.org/index.php/2014/06/install-latest-eclipse-ubuntu-14-04/

5 comments:

  1. Excellent post!!! The future of .net application development is on positive note. It offers huge career prospects for talented professionals all over the world. Training on .net technology will ensure good salary package. Best DOT NET Training institute in Chennai

    ReplyDelete
  2. Really awesome blog. Your blog is really useful for me.
    j2ee training in chennai

    ReplyDelete