argouml java-6-sun bug

FKtPp m_pupil at yahoo.com.cn
Wed Oct 24 14:06:45 UTC 2007


On Wed, Oct 24, 2007 at 07:29:39AM +0200, Michael Koch wrote:
> On Wed, Oct 24, 2007 at 10:43:33AM +0800, FKtPp wrote:
> > On Tue, Oct 23, 2007 at 07:56:48AM +0200, Michael Koch wrote:
> > > On Mon, Oct 22, 2007 at 08:56:26PM +0800, FKtPp wrote:
> > > > hi dear maintianers,
> > > > 
> > > > I found there's some bug in argouml package.
> > > > 
> > > > 1. the /usr/bin/argouml script didn't include new java vm/sdk path, I have to manual change it or set the environment variable $JAVA_HOME to make it run. But sun java 6 sdk is really a debian distributed java sdk, we should be able to run without modify.
> > > 
> > > Not necessarily. There are surely more runtimes that work with argouml.
> > > You want to force (different) specific java runtimes for every Java
> > > application and force the user to install many Java runtimes. Normally
> > > you want only one Java runtime and be done.
> > > 
> > 
> > So, why don't us make the argouml shellscript more portable? exp. try the 
> > recommanded jvm/jdk path first and then the default /usr/bin/java command.
> > 
> > Force user to set a environment variable to run argouml is really not user-friendly.
> 
> Feel free to provide a patch and attach it to a bug report.

What about this attached argouml.sh?

-------------- next part --------------
#!/bin/sh
# simple script used to run ArgoUML in Debian
# this script depends on debian-alternative micanishm
REQUIRED_JAVA_VERSION=3

JAVACMD=""

JAVAS=`/usr/sbin/update-alternatives --list java`

check_java_version() {

    JAVA_VERSION=`$1 -version 2>&1 \
	| awk -F\" '/java version/{print $2}' \
	| cut -d. -f2`

    if [ "$JAVA_VERSION" -a "$JAVA_VERSION" -gt $REQUIRED_JAVA_VERSION ]; then
	JAVACMD=$1
    else
	JAVACMD=""
    fi
}

# The first jvm to try is user defined JAVA_HOME (if JAVA_HOME is not
# defined in $DEFAULT)
if [ "$JAVA_HOME" ] ; then
    check_java_version "$JAVA_HOME/bin/java"
fi

if [ -z "$JAVACMD"] ; then

    for j in "$JAVAS"; do
	check_java_version $j
	test "$JAVACMD" && break
    done

fi


if [ "$JAVACMD" ] ; then
    $JAVACMD -jar /usr/share/java/argouml.jar "$@"
else
    echo "No suitable JVM found to run ArgoUML"
    echo "Please install a JVM to run ArgoUML or "
    echo "set JAVA_HOME if it's not a JVM from a Debian Package."
    exit 1
fi


More information about the pkg-java-maintainers mailing list