Bug#900356: jabref: JabRef does no longer start with Java8

tony mancill tmancill at debian.org
Mon Jun 18 05:47:09 BST 2018


On Sat, Jun 02, 2018 at 07:06:56PM +0200, gregor herrmann wrote:
> On Sat, 02 Jun 2018 09:59:55 -0700, tony mancill wrote:
> 
> > What I think we should do is try to detect if the jabref-wrapper is
> > being invoked with java8 and clear the options required for the java9
> > workaround.
> > If that sounds acceptable, I'll work on that.  (I should have done
> > something like that in the first place.)
> 
> Thanks, that was indeed my other idea :)

I took a close look at this and it could work in the simple case with
something like:

if find_java_runtime java9 ; then
    # We need some options to start this version on openjdk9 and later
    JABREF_JAVA_OPTS=${JABREF_JAVA_OPTS-"--add-modules=java.se.ee ...}
else
    find_java_runtime java8
fi

However, $(find_java_runtime java9) will happily return true if
JAVA_HOME, JAVA_CMD, or JAVA_BINDIR are set, regardless of what version
the function "finds," and so logic will fail if JAVA_HOME is set in the
user's environment (which I think is pretty common).

We could pretty easily extend java-wrappers with a new function that
invokes "java -version" to set a new variable, say JAVA_RUNTIME_VERSION,
but I would like to give that lot of testing before pushing such change.

For the time-being, I propose that we check the java version directly in
the jabref wrapper script like so:

JAVA_VERSION=$(run_java -version 2>&1 | grep ' version ' | awk '{print $3}')
if ! ( echo "$JAVA_VERSION" | grep -q '1.8.0' ) ; then
    # We need some options to start this version on openjdk9 and later
    JABREF_JAVA_OPTS=${JABREF_JAVA_OPTS-"--add-modules=java.se.ee ...}
fi

This works for all of my desk-tests and the updated jabref-wrapper has
been pushed to packaging repo.  If I don't hear any concerns, I'll
upload this week.

Cheers,
tony
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-maintainers/attachments/20180617/80935fd6/attachment.sig>


More information about the pkg-java-maintainers mailing list