Monday, September 26, 2011

Setting up Eclipse Indigo on Centos 5.7 x86_64

The version of Eclipse that is pre-packaged by Centos 5.7 is a rather old version.  If I'm reading it right, it is Eclipse 3.2.  I'm hoping that isn't really true, but because of that I'm going to install Eclipse myself.  Here are the steps I took to get it installed and running:
  1. Downloaded the latest version of Eclipse from http://www.eclipse.org/downloads/.  Making sure to select Linux as the OS and the 64 Bit version.
  2. su to root
  3. Move the tar ball to /opt/
  4. Run tar xvf on the tar ball.  This creates the eclipse directory
  5. Move /opt/eclipse/ to /opt/eclipse-indigo
  6. Create a symbolic link, ln -s /opt/eclipse-indigo /opt/eclipse. This allows us to install several versions of eclipse and then just change the link to the version we want to run.
  7. Create a desktop shortcut
    1. Right click on the desktop and selecting, "Create Launcher"
    2. Name is Eclipse
    3. Command is /opt/eclipse/eclipse
    4. Press the "No Icon" button and browse to /opt/eclipse and select icon.xpm
  8. Add eclipse executable to the path so we can run it from the command line if needed
    1. Run the following: '/usr/sbin/alternatives --install /etc/alternatives/eclipse eclipse /opt/eclipse/eclipse'. This will setup eclipse using the alternatives feature.
    2. Now create an alias by running: 'ln -s /etc/alternatives/eclipse /usr/bin/eclipse'.  This will create a symbolic link in /usr/bin, which is in the PATH to the eclipse setup by the alternatives.
That's it!