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,

dev_ides.sh

# 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
eclipseZip="eclipse-cpp-luna-R-linux-gtk-x86_64.tar.gz"
eclipseUrl="http://eclipse.mirror.rafal.ca/technology/epp/downloads/release/luna/R/$eclipseZip"
eclipseDir="eclipse-cpp"
  
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.."
eclipse=$(<./config/$eclipseDir)
cat <<EOF >/usr/bin/$eclipseDir
$eclipse
EOF
  
chmod 755 /usr/bin/$eclipseDir
  
echo "->> Creating a gnome menu item.."
eclipse_desktop=$(<./config/$eclipseDir.desktop)
cat <<EOF >/usr/share/applications/$eclipseDir.desktop
$eclipse_desktop
EOF
  
echo "->> Adding hack for debian wheezy to make eclipse luna work, according to -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=430736 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! 🙂
-Yohan

Leave a Reply

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