You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-11Lines changed: 64 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,41 @@ A modern Java 21 / JavaFX implementation of the Graph Digitizer tool for extract
47
47
48
48
-**[jlink / jpackage Guide](docs/JPACKAGE.md)** - How to create runtime images, cross-arch examples (Docker), and use `jpackage` for native installers.
49
49
50
+
### **Native Packaging (Windows)**
51
+
52
+
-**Symptom:** Packaged launcher could exit early during GUI startup due to the runtime attempting to load a missing assistive-technology provider (AccessBridge). This manifests as an AWTError about "Assistive Technology not found: com.sun.java.accessibility.AccessBridge" during toolkit initialization.
53
+
54
+
-**Fix applied:** The Windows `jpackage` launcher is now created with an explicit JVM option that disables assistive-technology lookups on startup:
-**Where it's configured:** In the project `pom.xml` under the `native` profile's `jpackage-app-image` execution. The produced launcher (`target/jpackage/GraphDigitizer/app/GraphDigitizer.cfg`) will include the `java-options=-Djavax.accessibility.assistive_technologies=` entry so the packaged app does not attempt to load `com.sun.java.accessibility.AccessBridge` at runtime.
61
+
62
+
-**How to build (PowerShell):** quote properties in PowerShell so Maven parses them correctly, and use the `preserve.appimage` property to keep the `app-image` folder for inspection:
-**Alternative:** If full assistive-technology support is required, bundle the appropriate Access Bridge classes in the runtime and enable them explicitly. For most users, disabling the lookup is lighter and avoids the ClassNotFoundException.
80
+
81
+
-**Notes:**
82
+
- The `preserve.appimage` Maven property is used during the build to avoid an automated cleanup of `target/jpackage/GraphDigitizer` so you can inspect the `app` and `runtime` folders. In PowerShell, quote the `-Dpreserve.appimage=true` argument as shown above.
83
+
- The change is safe for end users — it prevents an unnecessary classloading attempt when the AccessBridge is not present and does not affect normal GUI behavior.
84
+
50
85
### Packaging Scripts
51
86
52
87
@@ -59,35 +94,53 @@ A modern Java 21 / JavaFX implementation of the Graph Digitizer tool for extract
59
94
60
95
-**[Latest API (Javadoc)](https://mrhunsaker.github.io/Graph_Digitizer_Java_Implementation/)** – Generated from the current main branch
61
96
97
+
-**Local Javadoc:** To regenerate the API docs locally run:
98
+
99
+
```powershell
100
+
mvn javadoc:javadoc
101
+
```
102
+
103
+
The generated docs are written to `target/site/apidocs`.
104
+
62
105
-**Versioned Archives:** Each release will publish Javadocs under a subdirectory (e.g. `/1.1/`, `/1.2/`). Navigate directly to a version path to view older APIs.
63
106
64
107
## Quick Start
65
108
66
-
### Prerequisites
109
+
### Java & JavaFX Requirements
67
110
111
+
This project uses Java 21 and JavaFX 21 (see `<properties>` in `pom.xml`). Packaging and runtime behavior depend on two things matching correctly:
- Java runtime (JDK/JRE) that is compatible with JavaFX (HotSpot builds are recommended). We recommend using Eclipse Temurin (HotSpot) builds for packaging and runtime (`Java 21` LTS builds are tested). Avoid using OpenJ9 builds for the runtime image used by `jlink`/`jpackage` since some OpenJ9 builds have exhibited native compatibility issues with JavaFX in past tests.
114
+
115
+
- Matching JavaFX platform artifacts (jmods or platform jars) for the same JavaFX release (example: `javafx-21.0.2`). When creating runtime images with `jlink` you should use JavaFX `jmods` that match your JavaFX dependency version; for `jpackage` windows app-images we copy the platform jars into the app `lib/` directory so the launcher can find native JavaFX libraries at runtime.
116
+
117
+
Where to get them:
118
+
119
+
- Java (Temurin): https://adoptium.net/ — download the matching Java 21 (x64/arm64) HotSpot builds. Use the `jmods` or full JDK for `jlink`.
120
+
- JavaFX SDK / jmods: https://openjfx.io/ or Gluon (https://gluonhq.com/products/javafx/) — download the JavaFX SDK / jmods that match the JavaFX version in `pom.xml`.
121
+
122
+
Packaging tips:
123
+
124
+
- Use a Temurin HotSpot JDK when running `jlink` and `jpackage` to produce the runtime image; specify the `--runtime-image` jlink output when invoking `jpackage`.
125
+
- Ensure the JavaFX classifier/platform (e.g., `win`, `linux`, `mac`) matches the target OS when copying platform jars into `target/jpackage-input/lib`.
126
+
- If you run into native crashes or rendering issues, try rebuilding the runtime with another HotSpot build (Temurin) and ensure JavaFX versions match exactly.
71
127
128
+
See the `docs/JPACKAGE.md` for detailed packaging examples and cross-arch instructions.
Copy file name to clipboardExpand all lines: docs/JPACKAGE.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,12 @@ Example for Windows MSI (run on Windows host):
55
55
56
56
For ARM64 MSI you would pass `--runtime-image C:\path\to\runtime-arm64` (and run jpackage on a Windows host or produce a Windows-compatible runtime image accordingly).
57
57
58
+
### Recommended JVM & JavaFX builds
59
+
60
+
- Use a HotSpot JDK (we recommend Eclipse Temurin) for `jlink` and `jpackage` — HotSpot builds are the most commonly tested and are known to work well with JavaFX. Some OpenJ9 builds have shown native compatibility issues with JavaFX rendering or native libraries.
61
+
- Download JavaFX SDK/jmods that exactly match the `javafx.version` in `pom.xml` (for example `21.0.2`). Use the platform-specific `jmods` or platform jars for the target OS/arch.
62
+
- When creating runtime images, use the JDK that matches the target architecture (x64 vs arm64) and include `java.desktop` and `java.management` modules if your app uses AWT/Swing interop or management APIs.
63
+
58
64
## CI recommendations
59
65
60
66
@@ -69,6 +75,24 @@ For ARM64 MSI you would pass `--runtime-image C:\path\to\runtime-arm64` (and run
69
75
70
76
- If an MSI fails to install on a target arch, verify the runtime image architecture matches the target and that the app's native libraries (JavaFX) were built for that arch.
71
77
78
+
-**AWT / Accessibility startup error**: On some Windows systems the bundled launcher may attempt to load the Java Accessibility Access Bridge (`com.sun.java.accessibility.AccessBridge`) which is not always present in minimal runtime images. When the AWT Toolkit attempts to load configured assistive technologies and the AccessBridge class is missing, startup can fail with an `AWTError: Assistive Technology not found: com.sun.java.accessibility.AccessBridge`.
79
+
80
+
- Quick workaround (recommended for most builds): instruct the JVM to skip assistive-technology lookups by adding the JVM option:
81
+
82
+
```text
83
+
-Djavax.accessibility.assistive_technologies=
84
+
```
85
+
86
+
When using `jpackage` this should be included as a `--java-options` argument so generated launchers include the property. Example (snippet from this project's `pom.xml`):
- Alternative: if you require full Access Bridge support, bundle the AccessBridge classes and native bits in the runtime image and enable them explicitly. This increases runtime size and complexity and is only needed for systems that rely on the Access Bridge.
93
+
94
+
- Note: This project's `README.md` and `pom.xml` are updated to include this `--java-options` by default for the Windows `jpackage` steps.
- "Re-run packaging and keep app-image" — re-run `mvn -DskipTests package -Pnative` but skip the cleanup step so the `app-image` folder remains under `target/jpackage/GraphDigitizer` (I can do this and then list its contents).
23
+
- "Build and sign MSI" — run the packaging and then apply codesigning (requires access to a signing certificate).
24
+
25
+
Commands used to reproduce the run
26
+
27
+
1) Build + prepare jpackage input and run jpackage profile:
28
+
29
+
```powershell
30
+
mvn -DskipTests package -Pnative
31
+
```
32
+
33
+
2) Create the jlink runtime image (example used in this run):
- The `pom.xml` in the `native` profile was updated to copy runtime-scoped dependencies into `target/jpackage-input/lib` and to pass `--runtime-image ${project.build.directory}/jlink-image` to `jpackage`.
57
+
- If you'd like, I can re-run packaging to preserve the `app-image` folder and then enumerate its contents and sizes.
0 commit comments