Bug#890905: jabref: does not launch
gregor herrmann
gregoa at debian.org
Fri Mar 16 17:32:12 UTC 2018
Control: retitle -1 jabref: fails to build and start with openjdk-9
Control: severity -1 serious
Control: tag -1 + patch
On Fri, 23 Feb 2018 14:38:04 +0100, gregor herrmann wrote:
> Good. Now we at least know that the current jabref doesn't run with
> openjdk9. Let's see if we earlier find the deeper problem or get a
> newer jabref into debian :)
Now that default-jdk and default-jre point to openjdk-9, the problem
of the wrong default java runtime becomes more pressing, but jabref
also doesn't build anymore.
While the build failure looks like a gradle(-debian-helper) problem
...
dh build --buildsystem=gradle
dh_update_autotools_config -O--buildsystem=gradle
dh_autoreconf -O--buildsystem=gradle
dh_auto_configure -O--buildsystem=gradle
dh_auto_build -O--buildsystem=gradle
mkdir -p .gradle/init.d
cp /usr/share/gradle-debian-helper/init.gradle .gradle/init.d/
gradle --info --console plain --offline --stacktrace --no-daemon --refresh-dependencies --gradle-user-home .gradle -Duser.home=. -Duser.name=debian -Ddebian.package=jabref -Dfile.encoding=UTF-8 --parallel --max-workers=4 jar
Initialized native services in: /build/jabref-3.8.2+ds/.gradle/native
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine java version from '9.0.1'.
* Try:
Run with --debug option to get more log output.
* Exception is:
java.lang.IllegalArgumentException: Could not determine java version from '9.0.1'.
at org.gradle.api.JavaVersion.toVersion(JavaVersion.java:70)
at org.gradle.api.JavaVersion.current(JavaVersion.java:80)
at org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:32)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:210)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:174)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
dh_auto_build: gradle --info --console plain --offline --stacktrace --no-daemon --refresh-dependencies --gradle-user-home .gradle -Duser.home=. -Duser.name=debian -Ddebian.package=jabref -Dfile.encoding=UTF-8 --parallel --max-workers=4 jar returned exit code 1
make: *** [debian/rules:6: build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
... we know from upstream that the build would fail later anyway.
I guess forcing openjdk-8 at buildtime and runtime would be ok for
now? I've come up with the following patch, which seems to work. Any
comments?
#v+
diff --git a/debian/control b/debian/control
index 2d5b97e05..2b2890755 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Build-Depends-Indep: ant,
antlr,
antlr3,
antlr4,
- default-jdk (>= 2:1.8),
+ openjdk-8-jdk,
junit4,
libandroid-json-java,
libantlr3-runtime-java,
@@ -45,7 +45,7 @@ Homepage: https://www.jabref.org/
Package: jabref
Architecture: all
Depends: ${misc:Depends},
- default-jre (>= 2:1.8) | java8-runtime,
+ openjdk-8-jre,
java-wrappers,
libandroid-json-java,
libantlr3-runtime-java,
diff --git a/debian/jabref-wrapper b/debian/jabref-wrapper
index adbe78582..f13ec262d 100755
--- a/debian/jabref-wrapper
+++ b/debian/jabref-wrapper
@@ -4,7 +4,8 @@
. /usr/lib/java-wrappers/java-wrappers.sh
# We need a java8 runtime
-find_java_runtime java8
+# as this is also provided by openjdk9, we hardcode openjdk8 here
+find_java_runtime openjdk8
find_jars \
jabref \
diff --git a/debian/rules b/debian/rules
index d1809cdef..f71523da5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,6 +2,10 @@
export DH_VERBOSE=1
+# force build with openjdk-8, even if -9 is installed
+include /usr/share/dpkg/architecture.mk
+export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-$(DEB_HOST_ARCH)
+
%:
dh $@ --buildsystem=gradle
#v-
Cheers,
gregor
--
.''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org
: :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06
`. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
`- NP: Pink Floyd: Sorrow
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: Digital Signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20180316/f2ae4ea2/attachment-0001.sig>
More information about the pkg-java-maintainers
mailing list