Back to home
<<Back to Linux Notebook

Introduction
As I have mentioned elsehwere in this notebook, I prefer Metrowerks Codewarrior 9 for Windows to any other C/C++ IDE. I have tried KDevelop, but have not really been that happy with it. I am currently trying out Eclipse, because a friend of mine uses it, and because I have read good things about it.

Unfortunately, the install process is not really straight-forward, and I had a great deal of trouble locating a decent page describing how to install it. The biggest difficulty was getting the Java Runtime Environment installed properly. I owe the successful installation to the following: Here is the install process that was successful for me. Keep in mind that I am using Debian 3.1 (Sarge).
(written 11/10/2005)




Installing the Java Runtime Environment
  1. Make sure that contrib is included in your APT sources. For instance, my /etc/apt/sources.list contains the following line:
    deb http://http.us.debian.org/debian sarge main contrib non-free

  2. Then, as root, update your package list

    su
    apt-get update

  3. Install the java-package package

    apt-get install java-package

  4. Download Java. I only have experience installing the Sun Java 1.5.0 for 32-bit x86, so that is the one I will describe installing here. Obviously, choose the one appropriate for your installation. I downloaded the one from the link that says "Download JDK 5.0 Update 5".

    You want the one that ends in just .bin, NOT the one that ends in .rpm.bin, and not the one with the NetBeans Bundle. I saved the binary to a temp directory in my home directory. It doesn't matter where you save it to.

  5. Next, you need to Debian-ize the archive, and convert it into a Debian package. Do not do this as root. Exit first. Assuming you do this from the directory that the .bin is located in, it will create the .deb in that same directory.

    exit
    fakeroot make-jpkg jre-1_5_0_05-linux-i586.bin

  6. Install the Debian package that was created in the previous step

    su
    dpkg -i sun-j2re1.5_1.5.0+update05_i386.deb

  7. Check to see that it was installed correctly

    java -version

    Actually, when I did this, I received a "java: command not found" error. For some reason, the path wasn't updated.

(written 11/10/2005)




Adding Java to the Path
Here's how I fixed my path:
  1. First check to see what the path currently is. As a normal user, type

    echo $PATH

    I saw the following:
    /usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:

  2. Determine where java was actually installed to

    su
    updatedb
    locate j2sdk1.5-sun | grep javah

    If you installed the JRE instead of the SDK, then you'll probably want to locate j2jre instead. Mine returned

    usr/lib/j2sdk1.5-sun/bin/javah

    along with a bunch of other stuff. So I knew I had to add

    /usr/lib/j2sdk1.5-sun/bin/

    to my path.

  3. Update the path by copying the results from Step 1, and adding the path to java

    exit
    export PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/usr/lib/j2sdk1.5-sun/bin

  4. Now when you type

    java -version

    you should see something that looks like

    java version "1.5.0_05"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
    Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

    Unfortunately, this only adds java to the path for this session.
(written 11/10/2005)




Install Eclipse
The hard part is over now.
  1. Go to the Eclipse Downloads page, and download the appropriate tarball. At the time of this writing, the newest version available was 3.1.1. So, I downloaded

    eclipse-SDK-3.1.1-linux-gtk.tar.gz

  2. Copy the file to an appropriate location for unpacking. I chose /usr/bin

    su
    cp eclipse-SDK-3.1.1-linux-gtk.tar.gz /usr/bin/

  3. Unpack the tarball

    cd /usr/bin/
    tar -xzvf eclipse-SDK-3.1.1-linux-gtk.tar.gz

    It should create the /usr/bin/eclipse directory and unpack the contents there.

  4. Run eclipse

    exit
    /usr/bin/eclipse &
It fired right up for me.
(written 11/10/2005)




Installing CDT
Of course, if you want to do C/C++ programming, you will also need CDT. The steps are exactly the same as for installing Eclipse.
  1. Go to the Eclipse Downloads page, and download the appropriate tarball. At the time of this writing, the newest version available was CDT 3.0.1. So, I downloaded

    org.eclipse.cdt-3.0.1-linux.x86.tar.gz

  2. Copy the file to wherever you unpacked eclipse (I unpacked it in /usr/bin)

    su
    cp org.eclipse.cdt-3.0.1-linux.x86.tar.gz /usr/bin/

  3. Unpack the tarball

    cd /usr/bin/
    tar -xzvf org.eclipse.cdt-3.0.1-linux.x86.tar.gz

    It should create the /usr/bin/eclipse/plugins directory and unpack the contents there.

  4. Run eclipse again

    exit
    /usr/bin/eclipse &
Now when you look under File -> New -> Project, there should be C and C++ project types available.
(written 11/10/2005)




Create a Script to Run Eclipse
Ok, this next part is a pretty bad hack. The path has to be updated to include java before Eclipse can be launched. So, what I did was create a script to do this in one shot.
  1. As root, create a script called eclipse.sh in /usr/bin

    su
    cd /usr/bin
    nano -w eclipse.sh

  2. The script should include the following lines:

    PATH=$PATH:/usr/lib/j2sdk1.5-sun/bin
    /usr/bin/eclipse/eclipse

    The first line adds java to the path, and the second launches Eclipse.

  3. Make the script executable

    chmod 777 eclipse.sh
Now, I can add that to my KDE menu, and launch the application easily.
(written 11/11/2005)






Linux Notebook on FluggartFluggartEmail