First of all, you need to check whether you have java installed on your system. You can check by using the command:
java -version
If java is not installed, then you should install it by doing
sudo apt-get install default-jre
Afterwards, download Eclipse from the download section of the official website (http://www.eclipse.org/downloads/). Remember to choose the correct package for your architecture (32bit or 64 bit). The package will have the name:
eclipse-standard-kepler-SR1-linux-gtk-x86_32.tar.gz
or
eclipse-standard-kepler-SR1-linux-gtk-x86_64.tar.gz
After you have downloaded the correct package, extract the eclipse.XX.YY.tar.gz using
tar -zxvf eclipse.XX.YY.tar.gz
switch to root user:
sudo -i
Copy the extracted folder to /opt
cp -r eclipse.XX.YY /opt
Create a desktop file in the location /usr/share/applications and install it:
gedit eclipse.desktop
Copy the following to the eclipse.desktop file.
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=eclipse
Terminal=false
Icon=eclipse
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
Give the desktop file permission to be executed, run:
chmod +x eclipse.desktop
Run the following command to automatically install it in the unity:
desktop-file-install eclipse.desktop
Create a symlink in /usr/local/bin using
cd /usr/local/bin
ln -s /opt/eclipse/eclipse
For an eclipse icon to be displayed in dash, eclipse icon can be added as
cp /opt/eclipse/icon.xpm /usr/share/pixmaps/eclipse.xpm
Best Answer
Delete any previous launcher for Eclipse you may have made, this will create a completely new one.
Run these commands:
Then, put these into the fields, leave others default (You can actually put whatever you want in these, except "Command"):
eclipse
executable fileicon.xpm
, in the same folder as theeclipse
executableicon.xpm
Click "OK", then search the Dash for your new icon.
See this screenshot for reference only: