Skip to content

Instantly share code, notes, and snippets.

@daisylb
Created July 8, 2011 03:03
Show Gist options
  • Save daisylb/1071034 to your computer and use it in GitHub Desktop.
Save daisylb/1071034 to your computer and use it in GitHub Desktop.
Installing the Latest Eclipse in Ubuntu
#!/bin/bash
# If you're reading this on the GitHub gist, scroll down for instructions.
# If not, go to https://gist.github.com/1071034
icon_url="http://shaun.boyblack.co.za/blog/wp-content/uploads/2009/05/maceclipse4.zip"
eclipse_bin="#!/bin/sh
export ECLIPSE_HOME='/opt/eclipse'
\$ECLIPSE_HOME/eclipse \$*"
eclipse_desktop="[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true"
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.zip "$icon_url"
tar xvf eclipse.tar.gz
unzip icon.zip 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

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- https://gist.github.com/raw/1071034/install-eclipse.sh)

  • 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 [1], download Eclipse, patch the icon so it looks less ugly, and put all of the right files in the right places.

[1]In my experience, Eclipse (particularly CDT) has been more stable under OpenJDK than the Sun JRE, even though Eclipse recommends it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment