I\'m trying to run a Java application with -Dsun.java2d.dpiaware=false
argument but nothing happens.
I expect to have a blurred UI but with normal size
Create a windows regedit new DWORD
Create the two .manifest file (JDK)
Create the two .manifest file (JRE)
Restart your java application.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.CRT"
version="9.0.21022.8"
processorArchitecture="amd64"
publicKeyToken="1fc8b3b9a1e18e3b">
</assemblyIdentity>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
This fix can be used for any program, not only Java.
If you need to fix the DPI for a JNLP application launcher, you have to add the following key to the resources section inside the .jnlp file :
<property name="sun.java2d.dpiaware" value="false"/>
After Upgrading Windows (e.g from win10 to win10 1607), you should apply this fix again if it doesn't work anymore.
you can simply use :
System.setProperty("prism.allowhidpi", "false");
It is important that this is at the very start of your application before your main arguments get initialized, i.e. before Application.launch() or at the begining of your main() function
try running the vm with -Dsun.java2d.uiScale=1
, it fixed my swing/vtk app