Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#52625 - [jre8-openjdk-headless] Installation breaks sub-pixel rendering in all versions of java

Attached to Project: Arch Linux
Opened by Moabit (Moabit) - Wednesday, 18 January 2017, 23:55 GMT
Last edited by Doug Newgard (Scimmia) - Saturday, 21 January 2017, 00:28 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Guillaume ALAUX (galaux)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No

Details

Description:

If I install jre8-openjdk-headless, then sub-pixel rendering is broken for Jabref. (See attached screenshot.) This is broken whether I use java-7-openjdk, java-8-jre/jre or java-8-openjdk/jre. However, if I uninstall `jre8-openjdk-headless`, then Jabref works fine with either of the two remaining java installs (java-7-openjdk or java-8-jre/jre).

Somehow, having jre8-openjdk-headless installed breaks the other java installations.

I tried to remove some of the files that jre8-openjdk-headless installs, in order to isolate the problem. However, launching jabref with either of the two remaining java installs (java-7-openjdk or java-8-jre/jre) totally fails now.

$ sudo rm -r /usr/lib/jvm/java-8-openjdk/jre/lib
$ jabref
/usr/lib/jvm/java-8-openjdk/jre/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

Again, I'm not sure how a (partial) install of jre8-openjdk-headless could affect the other java installs.


Additional info:
* package version(s): 8.u112-1
* Forum thread here: https://bbs.archlinux.org/viewtopic.php?pid=1682594
This task depends upon

Comment by Doug Newgard (Scimmia) - Friday, 20 January 2017, 15:23 GMT
How are you uninstalling jre8-openjdk-headless but still having jre8-openjdk?
Comment by Moabit (Moabit) - Friday, 20 January 2017, 21:28 GMT
I'm not. There are two broad situations:

1) jre8-openjdk-headless uninstalled. Test with java-7-openjdk (i.e. from `jre7-openjdk`) or java-8-jre/jre (i.e. from Oracle's `jre`). Rendering works fine.
2) jre8-openjdk-headless installed. Test with java-7-openjdk or java-8-jre/jre. Rendering is broken. I can further install jre8-openjdk, which is also broken.
Comment by Doug Newgard (Scimmia) - Saturday, 21 January 2017, 00:26 GMT
Ah, I was missing that the jre/jre one was the Oracle binaries.
Comment by Moabit (Moabit) - Saturday, 21 January 2017, 23:29 GMT
Yes, sorry, I was just using the names from `archlinux-java status`. I probably could have been clearer.
Comment by Moabit (Moabit) - Sunday, 22 January 2017, 12:03 GMT
I just tested the new jre8-openjdk-headless 8.u121-1. The problem is still present in this version.
Comment by Guillaume ALAUX (galaux) - Sunday, 22 January 2017, 20:32 GMT
I think your test protocol is flawed:

First of all it seems Jabref requires a JRE 8, not 7 (haven't checked on the upstream website though). When I set OpenJDK 7 as the default JRE (`sudo archlinux-java set java-7-openjdk/jre`) and try to run Jabref, I get the infamous `UnsupportedClassVersionError: net/sf/jabref/JabRefMain : Unsupported major.minor version 52.0` stating that it requires a JRE 8 [0]. So are you sure you managed to run Jabref with java-7-openjdk as you say?

Then you state that when you `rm` some of jre8-openjdk-headless files, running Jabref gives you an error. This clearly shows that jre8-openjdk was still configured as your default JRE. So you are **not** testing whether Jabref works with some JRE while jre8-openjdk-headless is uninstalled (just showing that a program – jre8-openjdk – can fail if removed some of its working files).

I have tested Jabref (installed from AUR – I assume this is how you installed it) running with aur/jre both while jre8-openjdk-headless is installed and not installed. Have a look at the screenshots but I see no difference.

If you still think jre8-openjdk-headless somehow disrupts some other JRE/JDK, could you please ensure the JRE/JDK you want to test is setup as the default while performing the testing (using `archlinux-java [status|set …]` each time please).

[0] https://stackoverflow.com/questions/22489398/unsupported-major-minor-version-52-0/35866015#35866015
Comment by Moabit (Moabit) - Sunday, 22 January 2017, 22:01 GMT
> I think your test protocol is flawed:

I'm not sure why we are getting conflicting results. I'm fairly sure I'm testing correctly, but I'll go through your comments, along with pastes from the terminal.

> First of all it seems Jabref requires a JRE 8, not 7 (haven't checked on the upstream website though). When I set OpenJDK 7 as the default JRE (`sudo archlinux-java set java-7-openjdk/jre`) and try to run Jabref, I get the infamous `UnsupportedClassVersionError: net/sf/jabref/JabRefMain : Unsupported major.minor version 52.0` stating that it requires a JRE 8 [0]. So are you sure you managed to run Jabref with java-7-openjdk as you say?

For me, archlinux-java status calls it `java-7-openjdk`, not `java-7-openjdk/jre`. However, both work anyway.

$ sudo archlinux-java set java-7-openjdk
$ archlinux-java status
Available Java environments:
java-7-openjdk (default)
java-8-jre/jre
$ jabref # works

$ sudo archlinux-java set java-7-openjdk/jre
$ archlinux-java status
Available Java environments:
java-7-openjdk (java-7-openjdk/jre default)
java-8-jre/jre
$ jabref # works

> Then you state that when you `rm` some of jre8-openjdk-headless files, running Jabref gives you an error. This clearly shows that jre8-openjdk was still configured as your default JRE. So you are **not** testing whether Jabref works with some JRE while jre8-openjdk-headless is uninstalled (just showing that a program – jre8-openjdk – can fail if removed some of its working files).

No, that's certainly not the case. I agree it doesn't seem to make sense, but it seems that a partial install of jre8-openjdk-headless *does* cause the other jre's to fail for me.

$ sudo pacman -S jre8-openjdk-headless
$ sudo archlinux-java set java-7-openjdk
$ archlinux-java status
Available Java environments:
java-7-openjdk (default)
java-8-jre/jre
java-8-openjdk/jre
$ jabref # subpixel rendering broken

$ sudo rm -r /usr/lib/jvm/java-8-openjdk/jre/lib
$ jabref # won't start
/usr/lib/jvm/java-8-openjdk/jre/bin/java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
$ archlinux-java status
Available Java environments:
java-7-openjdk (default)
java-8-jre/jre
java-8-openjdk/jre

$ sudo pacman -Rs jre8-openjdk-headless
$ archlinux-java status
Available Java environments:
java-7-openjdk (default)
java-8-jre/jre
$ jabref # works fine again


> I have tested Jabref (installed from AUR – I assume this is how you installed it) running with aur/jre both while jre8-openjdk-headless is installed and not installed. Have a look at the screenshots but I see no difference.

Yes, I did install it through AUR. I checked your screenshots, and I agree that both look fine.

> If you still think jre8-openjdk-headless somehow disrupts some other JRE/JDK, could you please ensure the JRE/JDK you want to test is setup as the default while performing the testing (using `archlinux-java [status|set …]` each time please).

Hmmmm… so I thought I'd test without `jre` installed, just to see what happened.

$ sudo pacman -Rdd jre
$ archlinux-java status
Available Java environments:
java-7-openjdk (default)
$ jabref # won't launch
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/sf/jabref/JabRefMain : Unsupported major.minor version 52.0

N.B. the *same* java-7-openjdk is set, but now I get that error you mentioned. Then, testing after reinstalling `jre`.

$ pacaur -S jre
$ archlinux-java status
Available Java environments:
java-7-openjdk (default)
java-8-jre/jre
$ jabref # starts

So perhaps jabref isn't respecting the default java that I pick using `archlinux-java`? It seems to prioritise the last in the list. i.e. regardless of what I select as default, I see the following.

With "first" two alphabetically-sorted versions installed:
java-7-openjdk <--- wouldn't have worked; presumably not using this one
java-8-jre/jre <--- probably using this one

With all three choices installed:
java-7-openjdk <--- wouldn't have worked; presumably not using this one
java-8-jre/jre <--- should work with perfect subpixel rendering; presumably not using this one
java-8-openjdk/jre <--- probably using this one, which also breaks subpixel rendering; also, removing files breaks jabref, so more support that this is the one being used.

Aaaaaand… ugh. The problem is that the jabref executable ignores `archlinux-java`.

$ </usr/bin/jabref
#!/bin/sh

# Force usage of latest java version
JVM_PATH=$(find /usr/lib/jvm/* -maxdepth 0 -type d | sort | tail -n1)
exec $JVM_PATH/jre/bin/java -jar /usr/share/java/jabref/JabRef-3.8.1.jar "$@"

Sigh. Sorry about the noise. So presumably in your case you didn't have the same selection of javas installed. So I guess there are two conflicting bugs here. One is that jabref ignores the selected java, and the other is that jre8-openjdk-headless breaks its rendering. Thanks for the comments anyway.
Comment by Moabit (Moabit) - Sunday, 22 January 2017, 22:01 GMT
Actually, I was just about to close this bug, but is the second part still applicable to here? i.e. the fact that jre8-openjdk-headless breaks jabref's rendering?
Comment by Guillaume ALAUX (galaux) - Monday, 23 January 2017, 13:01 GMT
I have also seen that Jabref from AUR manually forces the JRE to the last it finds in alphabetical order in `/usr/lib/jvm`.

So in your last answer today:

- Your very first test (when you just have openjdk7) fails because Jabref requires a JRE 8. Nothing unexpected here.
- Then you install aur/jre, you run Jabref and just mention that "it starts" which is expected as aur/jre is the last result that the `find` in Jabref start script will select and it is a JRE 8. Nothing wrong here but you fail to mention whether the subpixel rendering works which would have been useful in order to ensure it worked before installing something else.
- Then it seems you installed jre8-openjdk because I see it in the output of `archlinux-java status` and "yes" it will be selected by Jabref's `find`. Then you state that "[it] also breaks subpixel rendering" : but you are running Jabref with this precise jre8-openjdk, not with any **other** JRE which is the point of your bug report!
- I won't even talk about removing openjdk8 files. Please don't do that, this doesn't serve any purpose other than messing around with your system.

> is the second part still applicable to here? i.e. the fact that jre8-openjdk-headless breaks jabref's rendering?
I still fail to see any sound reasoning that would indicate jre8-openjdk-headless installed on your system breaks any other JRE/JDK's subpixel rendering.

Regarding your issue with the JRE that fails to display proper subpixel rendering: I see on the forum post you initially mentioned that you tweaked some configuration in `/etc/fonts/local.conf`. Have you tried removing it? If I were you, I would look towards the configuration you might have put. I didn't put any – apart from `export SILENT_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel"` and everything looks nice.
Comment by Moabit (Moabit) - Tuesday, 24 January 2017, 00:25 GMT
Thanks again for the reply. I totally agree with your first set of dot points. I meant to imply all of that in the last part of my long post, but clearly was not detailed enough. To clarify, subpixel rendering *does* work using aur/jre. And yes, I know removing those openjdk8 files was prone to failure, but I was testing the hypothesis that somehow they were being sourced when I selected the other java… and the resulting error was certainly consistent with that.

> the fact that jre8-openjdk-headless breaks jabref's rendering

I meant that *using* this would break jabref's rendering.

I actually didn't test with removing `/etc/fonts/local.conf`. However, I just tried removing the file, then restarting. I still get the same problem. I tried the same config as you did.
Comment by Jack Daniels (masterofamn) - Tuesday, 06 June 2017, 12:30 GMT
Hi,

I want to add my observations to this, as I experience the same problem (i.e. messed up subpixel hinting in Jabref):

I have one machine (I), on which everything works as expected and the fonts are OK:
$ archlinux-java status
Available Java environments:
java-7-openjdk/jre
java-8-openjdk (default)

This machine has Jabref installed from AUR (the jar of which I also used for the machine below).

Yesterday, I installed a new machine (II), on which Jabref Fonts are almost unreadable:
$ archlinux-java status
Available Java environments:
java-8-openjdk/jre (default)

In both cases I use _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'

Both machines are up to date, most obvious difference between the two:
(I) intel-graphics notebook
(II) nvidia-graphics desktop

I'd be happy to provide further information on the two machines as needed.

BTW changing settings in local.conf does not fix the problem for me.






Loading...