Skip to content

Installing Eclipse Luna in Debian Wheezy

Versión en español de esta publicación.
Debian is a Linux distribution that updates its package versions in long time intervals, when it comes to install brand new software there is always the chance that the new software versions located at the official repositories aren’t updated,

Debian focuses on stability and security rather than having the cutting edge software versions, I’m a regular Debian user and I use it everywhere I can, also, I like doing code and I like to have the latest versions of the tools I use, luckily we can install any package we want and we don’t strictly have to use the official repositories at least not for our desktop computer/laptop, is Linux!,

Also I like to automate any repetitive task I can to save some time and spend that time coding rather than doing repetitive things, that’s why I decided to make an installation script to install the latest Eclipse version at this time, Luna,

Luna has some issues with the default version of the glibc library that comes with Debian Wheezy but doing a small change in the eclpse.ini will make it work nicely, more info on that here, well here is the script to install Luna in your Debian Wheezy system, I have to mention what this script does,

  • Updates the System
  • Downloads Eclipse Luna for 64bit Systems
  • Removes previous installs if exists
  • Decompress, moves and sets some permissions in the downloaded folder
  • Creates a shortcut and adds a gnome menu item
  • Adds the hack to the eclipse.ini file to work with Debian
  • Clean

This script is specially useful to install Luna in multiple systems quickly,

# Run as root
echo "************************************************"
echo "Script that installs development ides for \
     doing programming in different languages " 
echo "************************************************"
# Before the install make sure our system is up to date
apt-get update
apt-get upgrade
# Script Config
echo "->> First remove previous install if exists.."
rm -rf /opt/$eclipseDir
rm /usr/bin/$eclipseDir
rm /usr/share/applications/$eclipseDir.desktop
echo "->> Downloading eclipse Luna.."
curl $eclipseUrl > /home/$eclipseZip
echo "->> Extracting eclipse Luna.."
tar -xzf /home/$eclipseZip -C /home
echo "->> Moving extracted files and setting permissions.."
mv /home/eclipse /opt/$eclipseDir
chown -R root:root /opt/$eclipseDir
chmod -R +r /opt/$eclipseDir
echo "->> Cleaning downloaded files.."
rm /home/$eclipseZip
echo "->> Creating and configuring executable.."
cat <<EOF >/usr/bin/$eclipseDir
chmod 755 /usr/bin/$eclipseDir
echo "->> Creating a gnome menu item.."
cat <<EOF >/usr/share/applications/$eclipseDir.desktop
echo "->> Adding hack for debian wheezy to make eclipse luna work, according to -> inserting config line to eclipse.ini"
sed -i.bak 's/.*--launcher.appendVmargs.*/&\n--launcher.GTK_version\n2/' /opt/$eclipseDir/eclipse.ini
echo "->> Install Finished Launching for the First Time.."
/opt/$eclipseDir/eclipse -clean &

Enjoy! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *