Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One solution for adjusting the scaling of a Java-centered program in Linux for a high DPI screen is to set the scaling factor for the Java runtime environment (JRE) using the JAVAOPTIONS environment variable.

To do this, you can add the following line to your shell startup file (e.g., ~/.bashrc or ~/.zshrc):

export JAVAOPTIONS='-Dsun.java2d.uiScale=2.0'

This will set the scaling factor to 2.0. You can adjust this value to suit your needs.

Once you've added this line to your shell startup file, restart your terminal or run source ~/.bashrc (or source ~/.zshrc) to apply the changes. Then, when you launch your Java-centered program, it should be scaled appropriately for your high DPI screen.