Skip to content

Thihup/holytime

Repository files navigation

Holytime

Steps to make Holyrics work with newer Java versions (11/17+). Overall, it works just fine. However, as much of its components were removed from standard JDKs, you must put it back to it work as it worked with JDK 8. The support for Windows XP was dropped from JDK 9, so only newer Windows version work with it.

This project produces a JLinked Java runtime, called Holytime, with all these steps already done (you can check out the scripts to see it in details)

(Note that these commands were tried with Linux, for Windows some of them may change a little bit, like from ":" to ";")

TL;DR

  • Download the Holytime (JDK runtime with all dependencies included)
  • Download the Holy-agent
  • Set the environment variable J2D_UISCALE to 96 (to avoid antialiasing issues)
  • Run holytime/bin/java -javaagent:holy-agent.jar -XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=holytime.cds -XX:+UseStringDeduplication -XX:+UseZGC -Dsun.java2d.d3d=false -jar Holyrics.[jar|exe]

Download

Extract the bundles

  1. Create a folder mods
  2. Move the ASM jars (asm-9.6.jar,asm-commons-9.6.jar,asm-tree-9.6.jar,asm-analysis-9.6.jar,asm-util-9.6.jar) and the Nashorn (nashorn-core-15.4.jar) to the mods folder.
  3. Extract the bundles (jaxws-ri-2.3.7.zip and openjfx-21_linux-x64_bin-sdk.zip) inside the mods folder.

In the end, you should have a structure similar to

mods
├── javafx-sdk-21
├── jaxws-ri
├── asm-9.6.jar
├── asm-analysis-9.6.jar
├── asm-commons-9.6.jar
├── asm-tree-9.6.jar
├── asm-util-9.6.jar
└── nashorn-core-15.4.jar

Command line

You need to include these folders in the module-path, and add all the modules in the root set with:

--module-path mods:mods/javafx-sdk-21/lib:mods/jaxb-ri/mod:mods/jaxws-ri/lib --add-modules ALL-MODULE-PATH

After that, you need to specify the --add-opens:

--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.desktop/java.awt.event=ALL-UNNAMED --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/javax.swing.table=ALL-UNNAMED --add-opens=java.desktop/sun.font=ALL-UNNAMED --add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED --add-exports=javafx.web/com.sun.webkit.dom=ALL-UNNAMED

Full command line

Linux:

java -Dsun.java2d.d3d=false --module-path mods:mods/javafx-sdk-21/lib:mods/jaxws-ri/lib --add-modules ALL-MODULE-PATH --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.desktop/java.awt.event=ALL-UNNAMED --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/javax.swing.table=ALL-UNNAMED --add-opens=java.desktop/sun.font=ALL-UNNAMED --add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED --add-exports=javafx.web/com.sun.webkit.dom=ALL-UNNAMED -jar Holyrics.jar

Windows:

java -Dsun.java2d.d3d=false --module-path mods;mods/javafx-sdk-21/lib;mods/jaxws-ri/lib --add-modules ALL-MODULE-PATH --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED --add-opens=java.desktop/java.awt.event=ALL-UNNAMED --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/javax.swing.table=ALL-UNNAMED --add-opens=java.desktop/sun.font=ALL-UNNAMED --add-exports=javafx.web/com.sun.webkit.dom=ALL-UNNAMED -jar Holyrics.exe

Tips

To have a lower RAM usage (less than 200 MB!)

  • You can use the ZGC garbage collector (-XX:+UseZGC)
  • You can enable the String deduplication (-XX:+UseStringDeduplication - It will only work with ZGC starting with JDK 18)
  • You can use CDS (starting with JDK 19, you can just use -XX:+AutoCreateSharedArchive -XX:SharedArchiveFile=app.cds)

Issues

Currently, there are some minor issues:

  • Antialiasing does not work correctly
    • It seems to be related to: java.lang.NoSuchFieldException: AA_TEXT_PROPERTY_KEY
  • The File icon shows either a broken image or the text "File"

Create a runtime with all the missing modules

jdeps --generate-module-info tmp ./mods/jaxws-ri/lib/jakarta.annotation-api.jar
javac --patch-module=java.annotation=mods/jaxws-ri/lib/jakarta.annotation-api.jar ./tmp/java.annotation/module-info.java
jar uf ./mods/jaxws-ri/lib/jakarta.annotation-api.jar -C ./tmp/java.annotation/ module-info.class
  • Generate the runtime
jlink --module-path mods:./mods/javafx-jmods-21\:./mods/jaxb-ri/mod:./mods/jaxws-ri/lib --add-modules ALL-MODULE-PATH,java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,java.logging,java.management,java.management.rmi,java.naming,java.net.http,java.prefs,java.rmi,java.scripting,java.se,java.security.jgss,java.security.sasl,java.smartcardio,java.sql,java.sql.rowset,java.transaction.xa,java.xml,java.xml.crypto,jdk.accessibility,jdk.charsets,jdk.crypto.cryptoki,jdk.crypto.ec,jdk.dynalink,jdk.httpserver,jdk.incubator.foreign,jdk.incubator.vector,jdk.internal.vm.ci,jdk.internal.vm.compiler,jdk.internal.vm.compiler.management,jdk.jdwp.agent,jdk.jfr,jdk.jsobject,jdk.localedata,jdk.management,jdk.management.agent,jdk.management.jfr,jdk.naming.dns,jdk.naming.rmi,jdk.net,jdk.nio.mapmode,jdk.sctp,jdk.security.auth,jdk.security.jgss,jdk.unsupported,jdk.xml.dom,jdk.zipfs --output holytime --compress 2

Anti-aliasing issues?

  • Try setting the J2D_UISCALE environment variable to 96