Bug#346110: eclipse: Here's the problem. . .

Sukant Hajra SpamGuard at earthlink.net
Fri Jan 6 08:51:49 UTC 2006


Package: eclipse
Version: 3.1.1-7
Followup-For: Bug #346110



The issue that is causing this problem is detailed in the following FAQ link:
http://wooledge.org/mywiki/BashFaq#faq24.  Here an excerpt of the code in
/usr/bin/eclipse that contains the problem.

if [ -z "${JAVA_HOME}" ]; then
    echo "searching for compatible vm..."
    cat /etc/eclipse/java_home | grep -v '^#' | grep -v '^$' | \
    while read JAVA_HOME; do
        echo -n "  testing ${JAVA_HOME}..."
        if [ -x "${JAVA_HOME}/bin/java" ]; then
            export JAVA_HOME
            echo "found"
            break
        else
            echo "not found"
        fi
    done
fi 

The problem is that the script is *piping* the filtered content of
/etc/eclipse/java_home into the while statement.  Regardless of the export of
JAVA_HOME, it's lost upon exiting the loop.   I don't know where this script
came from, but it's clearly never been tested in any real setting, because
there's no way for it to work unless the user executes it with JAVA_HOME
previously exported.

There's another complaint I have that I'll just tag along here.  I might do the
right thing and make a separate bugreport later (else maybe I'll just leave it
to someone else).   My complaint is that /usr/bin/eclipse uses zenity, but as
far as I checked, it doesn't appear to be listed in the package dependencies.
I don't think using zenity in a startup script is really the best way to go --
stdout and stderr should suffice.  There's no compelling reason to tie eclipse
to zenity.  I happened to have zenity installed on my computer, but for those
that don't, this package will be broken.

It seems this script needs to mature quite a bit.

- Sukant Hajra


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable'), (90, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-hole
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages eclipse depends on:
ii  eclipse-jdt                   3.1.1-7    Java Development Tools plug-ins fo
ii  eclipse-pde                   3.1.1-7    Plug-in Development Environment to
ii  eclipse-source                3.1.1-7    Eclipse source code plug-ins

eclipse recommends no packages.

-- no debconf information




More information about the pkg-java-maintainers mailing list