7/8/2011 - 3:03 AM

Installing the Latest Eclipse in Ubuntu

Installing the Latest Eclipse in Ubuntu

Installing the Latest Eclipse in Ubuntu

Here's a short shell script to quickly install the latest Eclipse in Ubuntu, since the one in the repositories is about two years old. As a bonus, it also replaces the ugly Eclipse icon with a `nicer one by Shaun Smith <>`_. Based on `these instructions <>`_.

* Run the script, like this: ``bash <(wget -qO-``
* When prompted, find the URL of the Eclipse Linux gzipped tarball you want to install from `the Eclipse website <>`_.

    * Note: The link that you want has text that looks like *[Australia] Australian Academic Research Network (http)* - right click this and choose *Copy Link Address* to get the URL the script wants.

* The script will install OpenJDK [#]_, download Eclipse, patch the icon so it looks less ugly, and put all of the right files in the right places.

.. [#] In my experience, Eclipse (particularly CDT) has been more stable under OpenJDK than the Sun JRE, even though Eclipse recommends it.

# If you're reading this on the GitHub gist, scroll down for instructions.
# If not, go to


export ECLIPSE_HOME='/opt/eclipse'
\$ECLIPSE_HOME/eclipse \$*"

eclipse_desktop="[Desktop Entry]
Comment=Eclipse IDE

echo "Enter the URL for the Eclipse gzipped tarball:"
read eclipse_url

echo "Installing dependencies..."
sudo apt-get install imagemagick openjdk-6-jre

echo "Downloading Eclipse..."
wget -O eclipse.tar.gz "$eclipse_url"

echo "Downloading improved icon..."
wget -O "$icon_url"

tar xvf eclipse.tar.gz
unzip MacEclipse4/EclipseLogo512.png
convert MacEclipse4/EclipseLogo512.png eclipse/icon.xpm
sudo mv eclipse /opt/eclipse
sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
echo -e "$eclipse_bin" | sudo tee /usr/bin/eclipse
echo -e "$eclipse_desktop" | sudo tee /usr/share/applications/eclipse.desktop