From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?B?QmrDtnJuIEjDtmZsaW5n?= Subject: Re: Java fontconfig issues Date: Fri, 29 Nov 2019 00:50:16 +0100 Message-ID: <20191129005016.3a034b2e@alma-ubu> References: <20191116115724.68eb6f31@terracrypt.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; boundary="Sig_/WW1D05b92HY/dzwIpDOm5iX"; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41695) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iaThr-0003gR-9Z for help-guix@gnu.org; Thu, 28 Nov 2019 19:00:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iaTYJ-0004ma-C5 for help-guix@gnu.org; Thu, 28 Nov 2019 18:50:29 -0500 Received: from m4s11.vlinux.de ([83.151.27.109]:58246 helo=bjoernhoefling.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iaTYH-0004be-5k for help-guix@gnu.org; Thu, 28 Nov 2019 18:50:26 -0500 In-Reply-To: <20191116115724.68eb6f31@terracrypt.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Jonathan Frederickson Cc: help-guix@gnu.org --Sig_/WW1D05b92HY/dzwIpDOm5iX Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Jonathan, On Sat, 16 Nov 2019 11:57:24 -0500 Jonathan Frederickson wrote: > I've been trying to run PCGen > (https://github.com/PCGen/pcgen/releases) on my laptop running Guix > System, so far without success. I know that ideally all software would > be installed through Guix itself, but this thing is a Java app with > several dependencies that aren't in Guix yet and... honestly, right at > this moment, I'd be fine with running the jar directly for now. >=20 > However, when attempting to run this Jar with openjdk installed, I get > a null pointer exception related to some font configuration code. This > seems related to an issue on the AdoptOpenJDK repos[0], which was > solved in that case by installing the fontconfig package (on a Debian > install in their case). However, installing fontconfig into my profile > in Guix hasn't done the trick. There's a workaround mentioned > involving creating a fontconfig.properties file in JAVA_HOME, but > setting that as an environment variable didn't seem to do the trick > either. >=20 > While the specific application I'm focusing on is PCGen, this seems to > affect graphical Java applications in general; I tested with a > generic JAR build of Jitsi and ran into the same issue. >=20 > Can anyone familiar with Java provide some assistance in tracking down > this problem? >=20 > https://github.com/AdoptOpenJDK/openjdk-build/issues/693 I found that error too in ProjectLibre and even in Tomcat, which is not "graphical", but just uses fonts. Here is a very small program to trigger the error: import java.awt.*; public class Main { public static void main(String[] args) { String fonts[] =3D GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableF= ontFamilyNames(); for ( int i =3D 0; i < fonts.length; i++ ) { System.out.println(fonts[i]); } } } (I think I have that snipped from the AdoptOpenJDK-Bug, not 100% sure). If I enter a Guix-Container with OpenJDK 12 or 11 (not tried 10,9), compile and run it, it will fail (you need to compile new for each version because of different target versions) with the NullPointerException. As you mentioned, even adding fontconfig to that environment does not help. It works with JDK 8 though, provided through the icedtea@3 package. If your Java program still works with Java 8, that might be a workaround for you. Here are the specific environments I tried: guix environment -C --share=3D/tmp/.X11-unix --ad-hoc coreutils less grep = findutils ant which icedtea@3:jdk guix environment -C --share=3D/tmp/.X11-unix --ad-hoc coreutils less grep = findutils ant which openjdk@12:jdk guix environment -C --share=3D/tmp/.X11-unix --ad-hoc coreutils less grep = findutils ant which openjdk@11:jdk In each, I called these commands: $ javac Main.java $ java -cp . Main I see that fontconfig is a reference of both icedtea and openjdk: $ guix gc --references /gnu/store/05flqf4bqwwj4zwl2vqiqg0dlb1alzm8-icedtea-= 3.7.0-jdk | grep font /gnu/store/rkq6ipys8hf5hw66jkzzw4nfr6ncq96a-fontconfig-2.13.1 $ guix gc --references /gnu/store/wsl1wy131kgnvlyaiv4hz6a6ysavkcr8-openjdk-= 12.33-jdk/ | grep font /gnu/store/rkq6ipys8hf5hw66jkzzw4nfr6ncq96a-fontconfig-2.13.1 It looks like having the reference is not enough. Going from the AdoptOpenJDK bug to https://github.com/docker-library/openjdk/issues/46 leads to a bug report at debian's site: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D793210 They talked about different configure flags in there icedtea package and they have a fix for their JDK package. Here my time is out for now and my next free time slot might come only in two weeks. So, if someone else wants to look into this any earlier, I don't mind :-) Bj=C3=B6rn --Sig_/WW1D05b92HY/dzwIpDOm5iX Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCXeBdOAAKCRC/KGy2WT5f /fPEAKCzbZsnXy0nmz2RgaWJf8uY1vmdFQCfViPQoKOGznyn8KzEWCsBX9xxfEs= =ZtCY -----END PGP SIGNATURE----- --Sig_/WW1D05b92HY/dzwIpDOm5iX--