I've noticed a lot of questions on this mailing list regarding
installation of JDE (specifically JDEbug) and JDK on Linux.
I've just downloaded the latest JDK from Sun, and the latest JDE.
So I'm going to attempt to describe the step by step setup.

DISCLAIMER:
I (Mark Gibson) take no responsibility for any disasters that may occur
whilst following these instructions, neither does anyone else.
Try this at your risk!

Stuff on my system:
   RedHat Linux 6.0 (with lots of Rawhide RPM updates)
   JDK 1.2.2 rc4
   JDE 2.1.6beta22
   GNU/Emacs 20.3.1

This guide assumes you have root access. If not, everything can be
installed in your home directory (if you have room), but a word of
warning: Do not rely on tilda expansion in JDE (ie. ~/blahblah) use
the full path (eg. "/home/markg/blahblah").

1. Download the JDK from Sun at:
     http://java.sun.com/products/jdk/1.2/download-linux.html
   into the "/tmp" directory.

   A few days and download attempts later...
   (Check the download size is correct, downloading outside the US is
   very painful and prone to fall over at the very last moment!)

2. Untar the JDK somewhere, mine lives in "/opt" which is the recommended
   place under the linux filesystem for large packages like the JDK. 
   I have a symlink to the JDK directory set as "/opt/jdk -> /opt/jdk1.2.2".

   As root user:

   (create "/opt" if it doesn't exist)

   # cd /opt
   # tar xvzf /tmp/jdk1_2_2-linux-i386.tar.gz
   # ls -s jdk1.2.2 jdk

3. Set the environment variables.

   RedHat provides a handy directory for this: /etc/profile.d
   (I don't know if this is present in other distributions)
   I have attached two file with this guide: "jdk.sh" and "jdk.csh"
   Just copy these files into the "/etc/profile.d" directory.

   If you're doing a single user installation just added the files
   into your ".bashrc" or ".cshrc" file.

   These files add the JDK executable tools to the PATH variable,
   and sets the LD_LIBRARY_PATH variable so the debugger works without
   having to create symlinks in the JDK. (The jdk.csh requires editing
   to work with non-intel platforms, I don't use csh/tcsh).

4. Download the latest JDE from Pauls site at:
     http://sunsite.auc.dk/jde/jde-beta.tar.gz
   again into "/tmp".

5. Untar the JDE. I put it in "/usr/local/share/emacs" so all users can
   access it.

   # cd /usr/local/share/emacs
   # tar xvzf /tmp/jde-beta.tar.gz

   As with the JDK I use a symlink so updating later is easier.

   # ln -s jde-2.1.6beta22 jde

   You may have to change user and group ids on the untarred files:

   # chown -Rv root:root jde-2.1.6beta22

6. The next job is telling emacs where to look for JDE.

   If you're installing as root for use by all. Edit the "site-start.el"
   file, it will probably be in "/usr/share/emacs/site-lisp/" or
   "/usr/local/share/emacs/site-lisp/".

   If you're installing for your own use, then edit your personal ".emacs"
   file in your home directory (ie. "~/.emacs")

   Add the following to the file mentioned above:

     (add-to-list 'load-path "/usr/local/share/emacs/jde/lisp")

     (setq auto-mode-alist
        (append '(("\\.java$" . jde-mode) 
                  ) auto-mode-alist))

     (autoload 'jde-mode "jde" "Java Development Environment." t)

7. Now login as a normal user and start Emacs.
   Check JDE is present by excuting:
     M-x jde-mode

   You should see just the "JDE" and "Java" menus.

8. To setup the JDEBug:

   Open the "Jde Project" customisation buffer.

   In the "Jde Db Debugger" section set the Debugger option to "JDEbug".

   Set you classpaths/sourcepaths in the usual manner, including
   jde-db-source-directories.

   Then in the "Jde Bug" customisation buffer:

   Set the following options with the paths:

   jde-bug-jpda-directory : /opt/jdk
   jde-bug-jdk-directory  : /opt/jdk
   jde-bug-jre-home       : /opt/jdk/jre

9. Open a java file and debug away.

- Well it worked for me!

- Mark

- I would be interested to hear feedback from anyone who uses this
guide.
# JDK initialization script (sh)
if [ -z "$JDKDIR"  -o  "$JDKDIR" != "/opt/jdk" ] ; then
    JDKDIR="/opt/jdk"
    PATH="$JDKDIR/bin:$PATH"

    case "`uname -m`" in
    i[3-6]86 | ia32)
        proc=i386
        ;;
    sparc*)
        proc=sparc
        ;;
    *)
        proc="`uname -m`"
        ;;
    esac

    ld="$JDKDIR/lib/${proc}"

    if [ -z "$LD_LIBRARY_PATH" ] ; then
        LD_LIBRARY_PATH="$ld"
    else
        LD_LIBRARY_PATH="$ld:$LD_LIBRARY_PATH"
    fi

    export JDKDIR PATH LD_LIBRARY_PATH
fi
# JDK initialization script (csh)
if ( $?JDKDIR ) then
         if ( $JDKDIR == "/opt/jdk" ) then
         exit
         endif
endif
setenv JDKDIR /opt/jdk
setenv PATH "${JDKDIR}/bin:${PATH}"

# I'm not very familiar with csh as I only use bash.
# I don't know how to implement the processor check as performed
# in jdk.sh, sorry.

if ( $?LD_LIBRARY_PATH ) then
    setenv LD_LIBRARY_PATH "${JDKDIR}/lib/i386:${LD_LIBRARY_PATH}"
else
    setenv LD_LIBRARY_PATH "${JDKDIR}/lib/i386"
endif

Reply via email to