Post by bdz on Jun 10, 2022 20:27:19 GMT 1
I've just installed jjazzlab-3.2.1 on a debian system with a 5k monitor. The fonts, etc. are displaying at a very small size - nearly unreadable and definitely unusable. This is a well known problem with java - by default it assumes the 'standard' pre-5k resolution and cannot detect the monitor resolution (at least not under linux).
The solution is to set the VM property sun.java2d.uiScale, e.g
java -J-Dsun.java2d.uiScale=2 -jar some_swing_application.jar
Presumably I need to modify the launch script JJazzLab-3.2.1-Linux/bin/jjazzlab to set this property when the jjazzlab java app is launched. I've tried, but I haven't gotten it right.
I tried the following change. At the bottom of the jjazzlab sh script, there's a case section that appears to launch the java app:
case "`uname`" in
Darwin*)
eval exec sh '"$nbexec"' \
--jdkhome '"$jdkhome"' \
-J-Xdock:name='"$APP_DOCK_NAME"' \
'"-J-Xdock:icon=$progdir/../../$APPNAME.icns"' \
--clusters '"$clusters"' \
--userdir '"${userdir}"' \
--cachedir '"${cachedir}"' \
${default_options} \
"$args"
;;
*)
sh=sh
# #73162: Ubuntu uses the ancient Bourne shell, which does not implement trap well.
if [ -x /bin/bash ]
then
sh=/bin/bash
fi
eval exec $sh '"$nbexec"' \
--jdkhome '"$jdkhome"' \
--clusters '"$clusters"' \
--userdir '"${userdir}"' \
--cachedir '"${cachedir}"' \
${default_options} \
"$args"
exit 1
;;
esac
Presumably the 'Darwin' case is for OS X, so I added the property setting -J-Dsun.java2d.uiScale=2 to the second eval:
eval exec $sh '"$nbexec"' \
--jdkhome '"$jdkhome"' \
-J-Dsun.java2d.uiScale=2 \
--clusters '"$clusters"' \
--userdir '"${userdir}"' \
--cachedir '"${cachedir}"' \
${default_options} \
"$args"
This is wrong. Running the script with this line added throws an exception and launches Netbeans. There error thrown is
java.io.FileNotFoundException: /var/cache/lastModified/all-checksum.txt (No such file or directory)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:298)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:237)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:187)
at org.netbeans.Stamps.compareAndUpdateFile(Stamps.java:454)
at org.netbeans.Stamps.stamp(Stamps.java:341)
at org.netbeans.Stamps.moduleJARs(Stamps.java:292)
at org.netbeans.Stamps.file(Stamps.java:178)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:183)
at org.netbeans.Stamps.asByteBuffer(Stamps.java:163)
at org.netbeans.Archive.<init>(Archive.java:95)
at org.netbeans.JarClassLoader.initializeCache(JarClassLoader.java:84)
at org.netbeans.MainImpl$BootClassLoader.run(MainImpl.java:318)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:574)
at org.netbeans.CLIHandler.initialize(CLIHandler.java:360)
at org.netbeans.MainImpl.execute(MainImpl.java:168)
at org.netbeans.MainImpl.main(MainImpl.java:60)
at org.netbeans.Main.main(Main.java:58)
I'd appreciate any suggestions for fixing this.
Thanks