No support for HDPI/retina displays in Java 7/8

Bug #1497816 reported by Michael Gratton on 2015-09-21
This bug affects 4 people
Affects Status Importance Assigned to Milestone
openjdk-7 (Ubuntu)

Bug Description

I have Ubuntu Wily 15.10 installed on a MBP retina and Java GUI apps (sadly all too common in research fields) are not scaled up to cope with the high pixel density, and so are displayed with unreadable fonts, icons, etc, which make them unusable.

This is the case for both the OpenJDK 7 and 8 runtimes.

ProblemType: Bug
DistroRelease: Ubuntu 15.10
Package: openjdk-7-jre 7u85-2.6.1-2
ProcVersionSignature: Ubuntu 4.2.0-10.11-generic 4.2.0
Uname: Linux 4.2.0-10-generic x86_64
ApportVersion: 2.18.1-0ubuntu1
Architecture: amd64
CurrentDesktop: GNOME
Date: Mon Sep 21 12:58:21 2015
InstallationDate: Installed on 2015-07-22 (61 days ago)
InstallationMedia: Ubuntu-GNOME 15.04 "Vivid Vervet" - Release amd64 (20150422)
SourcePackage: openjdk-7
UpgradeStatus: Upgraded to wily on 2015-08-27 (24 days ago)

Michael Gratton (mjog) wrote :
Tiago Stürmer Daitx (tdaitx) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. OpenJDK does support high DPI displays such as the Retina Display, but sometimes the application is not configured correctly and/or might need additional settings to work.

Please take a look at

In particular, try adding these settings when calling the java binary:

If you don't know how to add those or the above settings don't fix your application, please answer these questions:

* What applications are affected by this?
* What version of the application?
* Are there any specific steps should we take to recreate this bug?

This will help us to find and resolve the problem.

Changed in openjdk-7 (Ubuntu):
status: New → Incomplete
Michael Gratton (mjog) wrote :

This isn't an application problem, it's a Java runtime problem. The Java developers need to add support for Retina/HiDPI to AWT/Swing in the same way that GTK+ and Qt needed support added. This has been done for both Windows and OSX versions of the runtime, but not for Linux. See

In any case, the applications affected by this for me personally include JOSM, Weka and Matlab. To recreate the issue, simply launch the applications on a computer with a high DPI (i.e. >200 DPI) display. Observe that the UI is unusable since all user interface elements are too small to be comfortably seen and interacted with.

Using the workaround about failed to fix the problem for both JOSM and Weka, using the current versions of those applications as available in Ubuntu Wily. To test this, I executed the following:

> JAVA_OPTS='-Dsun.java2d.xrender=true -Dswing.aatext=true -Dswing.aatext=true' jsom
> java -jar /usr/share/java/weka.jar -Dsun.java2d.xrender=true -Dswing.aatext=true -Dswing.aatext=true

In both cases, no change in the UI was observed, which is consistent with it being a runtime, not application problem.

Tiago Stürmer Daitx (tdaitx) wrote :


Thank you for taking the time to investigate and report this. Indeed JEP-263 makes clear that there is no support for Linux on OpenJDK. The linked bugs to that JEP also indicates that Windows is not supported yet. Only OSX has high DPI support.

Are you able to reproduce the issue with the simple java test case reported at ?

The answers to the question indicates that tuxjdk _might_ have fixes for at least the font aliasing issue, but some users report that it didn't work for them. This will require additional tests, including tests with GDK_SCALE or Gnome's scaling-factor setting to simulate a high dpi display. Additional information will be added to this bug as the investigation proceeds.

Michael Gratton (mjog) wrote :

The test case from JDK-8058742 also exhibits the problem with current openjdk-8-jdk from Wily.

Changed in openjdk-7 (Ubuntu):
status: Incomplete → New
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-7 (Ubuntu):
status: New → Confirmed
Changed in openjdk-7 (Ubuntu):
importance: Undecided → High
John (jweber53) wrote :

Application way too small is Impro-visor. Running openjdk-8 on Ubuntu-gnome 17.04. 3200x1800 13.3" Screen.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers