Eclipse

Pieter P

This is an installation guide for the Eclipse IDE on Ubuntu.

Install Java

The first step is to install the Oracle Java platform. The latest version at the time of writing this is Java SE 9.0.4.
How to install Java

Downloading Eclipse

Go to the Eclipse website and download the IDE. I prefer to use the portable version (without the installer).

The version of Eclipse that will be used in this guide is Eclipse Oxygen. It can be downloaded here.

Extracting and moving the downloaded files

When Eclipse has finished downloading, open a terminal (using CTRL+ALT+T).

First, navigate to the directory where you downloaded the file to (by default, this is ~/Downloads):

cd ~/Downloads
Move the file to /tmp and extract it:
mv eclipse-java-oxygen-2-linux-gtk-x86_64.tar.gz /tmp/
cd /tmp
tar -xzf eclipse-java-oxygen-2-linux-gtk-x86_64.tar.gz
Then move the extracted files to your software installation folder. I use ~/opt. If it doesn't exist, you have to create the folder first.
mkdir -p ~/opt/
mv eclipse ~/opt/

Create desktop launcher

Right now, you can go to ~/opt/eclipse and run Eclipse from there. However, that's pretty cumbersome, so we'll link Eclipse to the ~/.local/bin folder that's in the system's path. This allows you to execute Eclipse from the terminal.

mkdir -p ~/.local/bin/
ln -s "$HOME/opt/eclipse/eclipse" "$HOME/.local/bin/"
To check if everything works correctly, you can try to run Eclipse from the terminal:
eclipse

The next step is to add the Eclipse icon to the system's icon cache:

mkdir -p ~/.local/share/icons/hicolor/256x256/apps/
ln -s "$HOME/opt/eclipse/icon.xpm" "$HOME/.local/share/icons/hicolor/256x256/apps/eclipse.xpm"
gtk-update-icon-cache ~/.local/share/icons/hicolor

Finally, create a desktop launcher, to be able to open Eclipse from the Dash, or pin it to the launcher.

echo "[Desktop Entry]
Name=Eclipse Oxygen
Comment=Eclipse Oxygen
Exec=eclipse %F
Icon=eclipse
Terminal=false
Type=Application
Categories=Development;" > ~/.local/share/applications/eclipse.desktop
chmod +x ~/.local/share/applications/eclipse.desktop

After logging out and back in, you should be able to find Eclipse in the Dash.