Change:
JabRef 5 JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. JabRef is a desktop application and works equally well on Windows, Linux, and Mac OS X. While there is a JabRef Package it is the outdated Version 3. Metadata homepage URL: source URL: license: MIT platforms: unix, linux, darwin
We are still at the last 3 because JabRef 4 introduced some breaking changes that were not compatible with the state of Nixpkgs at that time, see Things are looking better with JabRef, but the is no longer shipped standalone. So downloading huge blob just to throw away much of it would be needed. This is discussed upstream at and - so feel free to ask for the bare in these threads or find someone to change the nix expression to build Jabref from source.
The JabRef team will not and cannot provide files anymore since this is no longer a supported distribution form in recent Java versions. Instead, we use jlink + jpackpage to package JabRef in form that includes all of the runtime dependencies (including the jre). We now also provide a deb package, so maybe this can be easily reused for nix as well. (The linked issue concern a bug in our development workflow where unnecessary files are included in the build version, but this shouldn't be of any concern for further distribution for nix.)
Thanks for the feedback. I had an attempt at building the latest release from source, but hit an issue with jlink, see here: I did not retry yet with master and OpenJDK 14. Any ideas what causes this collision?
This looks to me indeed like a problem with JDK 13. Does it work with 14?
Building tag v5.0 with Java14 fails due to this issue: (I did not yet try to bump Groovy to 2.5.9 on this tag.) Building with OpenJDK14 also fails with
Strange. The current master does compile on Linux as verified by our github build workflow... Why do you need to compile JabRef yourself?
It is the preferred way of packaging in nixpkgs.
I also failed to compile JabRef from source under nixos (not sure if I did something wrong as I am no java expert). Anyway here is how I packaged JabRef 5, using the deb: I am not sure if this is good enough to be included in nixpkgs. Let me know if you want me to open a PR with this.
Can you plaese try with using the AdoptOpenJDK jdk?

Discussion:
<del> { stdenv, fetchurl, makeWrapper, makeDesktopItem, jdk, jre, wrapGAppsHook, gtk3, gsettings-desktop-schemas }: </del> <ins> { stdenv, fetchurl, makeWrapper, makeDesktopItem, wrapGAppsHook, gtk3, gsettings-desktop-schemas , zlib , libX11, libXext, libXi, libXrender, libXtst, libGL, alsaLib, libav, cairo, freetype, pango, gdk-pixbuf, glib }: </ins> stdenv.mkDerivation rec { <del> version = "3.8.1"; </del> <ins> version = "5.1"; </ins> pname = "jabref"; src = fetchurl { <del> url = "https://github.com/JabRef/jabref/releases/download/v${version}/JabRef-${version}.jar"; sha256 = "11asfym74zdq46i217z5n6vc79gylcx8xn7nvwacfqmym0bz79cg"; </del> <ins> url = "https://github.com/JabRef/jabref/releases/download/v${version}/JabRef-${version}-portable_linux.tar.gz"; sha256 = "04f612byrq3agzy26byg1sgrjyhcpa8xfj0ssh8dl8d8vnhx9742"; </ins> }; <ins> preferLocalBuild = true; </ins> desktopItem = makeDesktopItem { comment =  meta.description; name = "jabref";

exec = "jabref"; }; <del> buildInputs = [ makeWrapper jdk wrapGAppsHook gtk3 gsettings-desktop-schemas ]; </del> <ins> nativeBuildInputs = [ makeWrapper wrapGAppsHook ]; buildInputs = [ gsettings-desktop-schemas ] ++ systemLibs; </ins> <del> dontUnpack = true; </del> <ins> systemLibs = [ gtk3 zlib libX11 libXext libXi libXrender libXtst libGL alsaLib libav cairo freetype pango gdk-pixbuf glib ]; systemLibPaths = stdenv.lib.makeLibraryPath systemLibs; </ins> installPhase = '' <del> mkdir -p $out/bin $out/share/java $out/share/icons </del> <ins> mkdir -p $out/share/java $out/share/icons </ins> <del> cp -r ${desktopItem}/share/applications $out/share/ </del> <ins> cp -r lib $out/lib for f in $out/lib/runtime/bin/j*; do patchelf  --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)"  --set-rpath "${ stdenv.lib.makeLibraryPath [ zlib ]}:$out/lib/runtime/lib:$out/lib/runtime/lib/server" $f done for f in $out/lib/runtime/lib/*.so; do patchelf  --set-rpath "${systemLibPaths}:$out/lib/runtime/lib:$out/lib/runtime/lib/server" $f done </ins> <del> jar xf $src images/icons/JabRef-icon-mac.svg cp images/icons/JabRef-icon-mac.svg $out/share/icons/jabref.svg </del> <ins> # patching the libs in the JImage runtime image is quite impossible as there is no documented way # of rebuilding the image after it has been extracted # the image format itself is "intendedly not documented" - maybe one of the reasons the # devolpers constantly broke "jimage recreate" and dropped it in OpenJDK 9 Build 116 Early Access # so, for now just copy the image and provide our lib paths through the wrapper makeWrapper $out/lib/runtime/bin/java $out/bin/jabref  --add-flags '-Djava.library.path=${systemLibPaths}' --add-flags "-p $out/lib/app -m org.jabref/org.jabref.JabRefLauncher"  --run 'export LD_LIBRARY_PATH=${systemLibPaths}:$LD_LIBRARY_PATH' cp -r ${desktopItem}/share/applications $out/share/ </ins> <del> ln -s $src $out/share/java/jabref-${version}.jar makeWrapper ${jre}/bin/java $out/bin/jabref  --add-flags "-jar $out/share/java/jabref-${version}.jar" </del> <ins> # we still need to unpack the runtime image to get the icon mkdir unpacked $out/lib/runtime/bin/jimage extract --dir=./unpacked lib/runtime/lib/modules cp unpacked/org.jabref/icons/jabref.svg $out/share/icons/jabref.svg </ins> ''; meta = with stdenv.lib; {