walk = Files.walk(classes)) {
+ walk.filter(Files::isRegularFile).forEach(p -> {
+ try {
+ jos.putNextEntry(new JarEntry(classes.relativize(p).toString().replace('\\', '/')));
+ Files.copy(p, jos);
+ jos.closeEntry();
+ } catch (IOException e) {
+ throw new UncheckedIOException(e);
+ }
+ });
+ }
+ return jar;
+ }
+}
diff --git a/beast-pkgmgmt/src/test/java/beast/pkgmgmt/launcher/SeedBundledPackageTest.java b/beast-pkgmgmt/src/test/java/beast/pkgmgmt/launcher/SeedBundledPackageTest.java
new file mode 100644
index 0000000..4e250f1
--- /dev/null
+++ b/beast-pkgmgmt/src/test/java/beast/pkgmgmt/launcher/SeedBundledPackageTest.java
@@ -0,0 +1,50 @@
+package beast.pkgmgmt.launcher;
+
+import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Test;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.stream.Stream;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * End-to-end check of {@link BeastLauncher#seedBundledPackage(String)}: discovery
+ * of a bundled package zip (via the launcher-jar parent walk), version parsing,
+ * and extraction into the user package directory.
+ *
+ * The test is a no-op unless a bundled zip is discoverable, i.e. a
+ * {@code BEAST.base.package.v*.zip} has been staged under a {@code packages/}
+ * directory in the launcher-jar parent chain (e.g. {@code beast-pkgmgmt/target/packages/}).
+ * It therefore passes silently on CI and does real work when run locally after staging.
+ */
+public class SeedBundledPackageTest {
+
+ @Test
+ public void seedsBaseIntoUserDir() throws Exception {
+ Path userDir = Files.createTempDirectory("beast-seed-test");
+ String prev = System.getProperty("beast.user.package.dir");
+ System.setProperty("beast.user.package.dir", userDir.toString());
+ try {
+ boolean handled = BeastLauncher.seedBundledPackage("BEAST.base");
+ Assumptions.assumeTrue(handled,
+ "no bundled BEAST.base zip staged under a packages/ dir - skipping");
+
+ Path versionXml = userDir.resolve("BEAST.base").resolve("version.xml");
+ Path lib = userDir.resolve("BEAST.base").resolve("lib");
+ assertTrue(Files.exists(versionXml), "version.xml should be extracted to the user dir");
+ assertTrue(Files.isDirectory(lib), "lib/ should be extracted to the user dir");
+ try (Stream jars = Files.list(lib)) {
+ assertTrue(jars.anyMatch(p -> p.toString().endsWith(".jar")),
+ "lib/ should contain at least one jar");
+ }
+ } finally {
+ if (prev == null) {
+ System.clearProperty("beast.user.package.dir");
+ } else {
+ System.setProperty("beast.user.package.dir", prev);
+ }
+ }
+ }
+}
diff --git a/release/Linux/linuxbin/applauncher b/release/Linux/linuxbin/applauncher
index 8394890..759324f 100755
--- a/release/Linux/linuxbin/applauncher
+++ b/release/Linux/linuxbin/applauncher
@@ -44,11 +44,11 @@ else
fi
if [ -n "$BEAST_EXTRA_LIBS" ]; then
- exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+ exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Djava.library.path="$BEAST_EXTRA_LIBS" -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher "$@"
else
- exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+ exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher "$@"
fi
diff --git a/release/Linux/linuxbin/beast b/release/Linux/linuxbin/beast
index 26113d9..16aae17 100755
--- a/release/Linux/linuxbin/beast
+++ b/release/Linux/linuxbin/beast
@@ -69,6 +69,6 @@ if [ -n "$BEAST_EXTRA_LIBS" ]; then
fi
fi
-exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Djava.library.path="$LD_LIBRARY_PATH" -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.BeastLauncher "$@"
diff --git a/release/Linux/linuxbin/beauti b/release/Linux/linuxbin/beauti
index f4f4e7f..29d61bb 100755
--- a/release/Linux/linuxbin/beauti
+++ b/release/Linux/linuxbin/beauti
@@ -25,6 +25,6 @@ JAVA_HOME="$BUNDLE_HOME/jre"
export JAVA_HOME
JAVA="$JAVA_HOME/bin/java"
APP="$BUNDLE_HOME/lib"
-exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.BeautiLauncher -capture "$@"
diff --git a/release/Linux/linuxbin/loganalyser b/release/Linux/linuxbin/loganalyser
index 71d8236..99c0365 100755
--- a/release/Linux/linuxbin/loganalyser
+++ b/release/Linux/linuxbin/loganalyser
@@ -44,11 +44,11 @@ else
fi
if [ -n "$BEAST_EXTRA_LIBS" ]; then
- exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+ exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Djava.library.path="$BEAST_EXTRA_LIBS" -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher beastfx.app.tools.LogAnalyser "$@"
else
- exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+ exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher beastfx.app.tools.LogAnalyser "$@"
fi
diff --git a/release/Linux/linuxbin/logcombiner b/release/Linux/linuxbin/logcombiner
index 9a6a4b2..ae1b372 100755
--- a/release/Linux/linuxbin/logcombiner
+++ b/release/Linux/linuxbin/logcombiner
@@ -25,6 +25,6 @@ JAVA_HOME="$BUNDLE_HOME/jre"
export JAVA_HOME
JAVA="$JAVA_HOME/bin/java"
APP="$BUNDLE_HOME/lib"
-exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.LogCombinerLauncher "$@"
diff --git a/release/Linux/linuxbin/packagemanager b/release/Linux/linuxbin/packagemanager
index 70fea70..c5e5f51 100755
--- a/release/Linux/linuxbin/packagemanager
+++ b/release/Linux/linuxbin/packagemanager
@@ -25,6 +25,6 @@ JAVA_HOME="$BUNDLE_HOME/jre"
export JAVA_HOME
JAVA="$JAVA_HOME/bin/java"
APP="$BUNDLE_HOME/lib"
-exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.PackageManager "$@"
diff --git a/release/Linux/linuxbin/treeannotator b/release/Linux/linuxbin/treeannotator
index fd8d1f1..df815c5 100755
--- a/release/Linux/linuxbin/treeannotator
+++ b/release/Linux/linuxbin/treeannotator
@@ -25,6 +25,6 @@ JAVA_HOME="$BUNDLE_HOME/jre"
export JAVA_HOME
JAVA="$JAVA_HOME/bin/java"
APP="$BUNDLE_HOME/lib"
-exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH \
+exec "$JAVA" --module-path "$APP" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.TreeAnnotatorLauncher "$@"
diff --git a/release/Mac/build-sign-dmg.sh b/release/Mac/build-sign-dmg.sh
index 9ffa67d..633a21a 100755
--- a/release/Mac/build-sign-dmg.sh
+++ b/release/Mac/build-sign-dmg.sh
@@ -169,6 +169,14 @@ find "$REPO_ROOT/beast-fx/target/lib" -name "*.jar" \
! -name "javafx-*" ! -name "jdk-jsobject-*" \
-exec cp {} "$STAGING/" \;
+# Move the core BEAST modules (beast.base, beast.fx) off the boot module path:
+# they ship as user-installable packages (bundled below, seeded into the user
+# package dir on first run, and loaded as plugin module layers) so the package
+# manager can upgrade them in place. The launcher (beast-pkgmgmt) and the
+# third-party dependencies stay on the boot module path; JavaFX is provided by
+# the bundled Zulu JRE+FX as platform modules.
+rm -f "$STAGING"/beast-base-*.jar "$STAGING"/beast-fx-*.jar
+
# Verify main JAR is present
if [ ! -f "$STAGING/$MAIN_JAR" ]; then
echo "ERROR: Main JAR not found in staging: $MAIN_JAR"
@@ -211,9 +219,14 @@ sed -i '' '/^app\.classpath/d' "$BEAST_CFG"
sed -i '' 's|^app\.mainclass=.*|app.mainmodule=beast.pkgmgmt/beast.pkgmgmt.launcher.BeastLauncher|' "$BEAST_CFG"
# The native launcher resolves $APPDIR to the app/ directory at runtime.
# Use = syntax because each java-options line is passed as a single JVM argument.
+# JavaFX and jdk.jsobject are added explicitly: beast.fx (which requires them) is no
+# longer on the boot module path, so nothing else pulls them out of the bundled
+# JRE+FX. Naming them here resolves them into the boot layer, where the beast.fx
+# plugin module layer reads them. Their transitive requires (javafx.graphics/base/
+# media) come along automatically.
sed -i '' '/^\[JavaOptions\]/a\
java-options=--module-path=\$APPDIR\
-java-options=--add-modules=ALL-MODULE-PATH
+java-options=--add-modules=ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject
' "$BEAST_CFG"
# jpackage may strip bin/java from the bundled runtime (it uses its own native
@@ -227,6 +240,26 @@ echo " Copied java binary from JRE+FX into runtime."
echo " BEAST.app created."
+# ── Bundle core package zips for first-run seeding ───────────────────────────
+# BEAST.base and BEAST.app ship as full package zips inside the app image
+# (Contents/app/packages/) rather than on the boot module path. On first launch
+# BeastLauncher.seedBundledPackage() extracts them into the user package dir, where
+# they load as plugin module layers, so the package manager can upgrade them in
+# place. Placed after jpackage so codesign seals them, in a subdirectory kept out
+# of the module path.
+APP_DIR_IN_BUNDLE="$OUTPUT/BEAST.app/Contents/app"
+mkdir -p "$APP_DIR_IN_BUNDLE/packages"
+BASE_PKG_ZIP=$(find "$REPO_ROOT/beast-base/target" -maxdepth 1 -name "BEAST.base.package.v*.zip" | head -1)
+APP_PKG_ZIP=$(find "$REPO_ROOT/beast-fx/target" -maxdepth 1 -name "BEAST.app.package.v*.zip" | head -1)
+for PKG_ZIP in "$BASE_PKG_ZIP" "$APP_PKG_ZIP"; do
+ if [ -z "$PKG_ZIP" ]; then
+ echo "ERROR: a core package zip was not found (run 'mvn package' first)"
+ exit 1
+ fi
+ cp "$PKG_ZIP" "$APP_DIR_IN_BUNDLE/packages/"
+ echo " Bundled $(basename "$PKG_ZIP") into Contents/app/packages/"
+done
+
# ── Step 3a: Create lightweight wrapper .app bundles ─────────────────────────
@@ -249,17 +282,25 @@ build_wrapper_app() {
# ── Launcher shell script ──
# Derive the module/class from the fully qualified main class
# e.g. beast.pkgmgmt.launcher.BeautiLauncher → -m beast.pkgmgmt/beast.pkgmgmt.launcher.BeautiLauncher
+ #
+ # --add-modules MUST name javafx.* and jdk.jsobject explicitly, exactly as
+ # BEAST.cfg does for the jpackage launcher. The JavaFX JARs are no longer on
+ # the module path ($BEAST_APP/app) — they come from the bundled JRE+FX as
+ # platform modules, which ALL-MODULE-PATH does not pull in. The launcher loads
+ # beast.fx as a plugin ModuleLayer; beast.fx requires javafx.graphics/controls,
+ # so without these the GUI apps (BEAUti/TreeAnnotator/LogCombiner/AppLauncher)
+ # fail module resolution and die silently when double-clicked from Finder.
local module_name
module_name=$(echo "$main_class" | sed 's/\.launcher\..*//')
local launch_cmd
if [ -n "$extra_args" ]; then
launch_cmd="exec \"\$BEAST_APP/runtime/Contents/Home/bin/java\" \\
- --module-path \"\$BEAST_APP/app\" --add-modules ALL-MODULE-PATH \\
+ --module-path \"\$BEAST_APP/app\" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \\
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \\
-m $module_name/$main_class $extra_args \"\$@\""
else
launch_cmd="exec \"\$BEAST_APP/runtime/Contents/Home/bin/java\" \\
- --module-path \"\$BEAST_APP/app\" --add-modules ALL-MODULE-PATH \\
+ --module-path \"\$BEAST_APP/app\" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \\
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \\
-m $module_name/$main_class \"\$@\""
fi
diff --git a/release/Mac/macbin/applauncher b/release/Mac/macbin/applauncher
index ea202fc..2174ef5 100755
--- a/release/Mac/macbin/applauncher
+++ b/release/Mac/macbin/applauncher
@@ -45,12 +45,12 @@ fi
if [ -n "$BEAST_EXTRA_LIBS" ]; then
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Djava.library.path="$BEAST_EXTRA_LIBS" -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher "$@"
else
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher "$@"
fi
diff --git a/release/Mac/macbin/beast b/release/Mac/macbin/beast
index 3671c1c..44e6550 100755
--- a/release/Mac/macbin/beast
+++ b/release/Mac/macbin/beast
@@ -71,6 +71,6 @@ if [ -n "$BEAST_EXTRA_LIBS" ]; then
fi
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Djava.library.path="$LD_LIBRARY_PATH" -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.BeastLauncher "$@"
diff --git a/release/Mac/macbin/beauti b/release/Mac/macbin/beauti
index 26a6015..d90de71 100755
--- a/release/Mac/macbin/beauti
+++ b/release/Mac/macbin/beauti
@@ -27,6 +27,6 @@ BEAST_APP="$BEAST/BEAST.app/Contents"
export JAVA_HOME="$BEAST_APP/runtime/Contents/Home"
JAVA="$JAVA_HOME/bin/java"
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.BeautiLauncher -capture "$@"
diff --git a/release/Mac/macbin/loganalyser b/release/Mac/macbin/loganalyser
index 7d29312..c56529f 100755
--- a/release/Mac/macbin/loganalyser
+++ b/release/Mac/macbin/loganalyser
@@ -45,12 +45,12 @@ fi
if [ -n "$BEAST_EXTRA_LIBS" ]; then
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Djava.library.path="$BEAST_EXTRA_LIBS" -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher beastfx.app.tools.LogAnalyser "$@"
else
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher beastfx.app.tools.LogAnalyser "$@"
fi
diff --git a/release/Mac/macbin/logcombiner b/release/Mac/macbin/logcombiner
index edbdaa9..7064c40 100755
--- a/release/Mac/macbin/logcombiner
+++ b/release/Mac/macbin/logcombiner
@@ -27,6 +27,6 @@ BEAST_APP="$BEAST/BEAST.app/Contents"
export JAVA_HOME="$BEAST_APP/runtime/Contents/Home"
JAVA="$JAVA_HOME/bin/java"
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.LogCombinerLauncher "$@"
diff --git a/release/Mac/macbin/packagemanager b/release/Mac/macbin/packagemanager
index 7f41cc5..e097f68 100755
--- a/release/Mac/macbin/packagemanager
+++ b/release/Mac/macbin/packagemanager
@@ -27,6 +27,6 @@ BEAST_APP="$BEAST/BEAST.app/Contents"
export JAVA_HOME="$BEAST_APP/runtime/Contents/Home"
JAVA="$JAVA_HOME/bin/java"
"$JAVA" \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.PackageManager "$@"
diff --git a/release/Mac/macbin/treeannotator b/release/Mac/macbin/treeannotator
index e0b00be..9ce4c93 100755
--- a/release/Mac/macbin/treeannotator
+++ b/release/Mac/macbin/treeannotator
@@ -27,6 +27,6 @@ BEAST_APP="$BEAST/BEAST.app/Contents"
export JAVA_HOME="$BEAST_APP/runtime/Contents/Home"
JAVA="$JAVA_HOME/bin/java"
"$JAVA" -Dlauncher.wait.for.exit=true \
- --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH \
+ --module-path "$BEAST_APP/app" --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject \
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 \
-m beast.pkgmgmt/beast.pkgmgmt.launcher.TreeAnnotatorLauncher "$@"
diff --git a/release/Windows/assemble-bundle.sh b/release/Windows/assemble-bundle.sh
index 6ba155d..a5cf286 100644
--- a/release/Windows/assemble-bundle.sh
+++ b/release/Windows/assemble-bundle.sh
@@ -185,16 +185,22 @@ echo " Exe files at bundle root: $(find "$BUNDLE" -maxdepth 1 -name '*.exe' |
# jpackage emits classpath-mode cfg when --main-jar is used. Three transforms:
# 1. Delete app.classpath= (all JARs go on module-path, not classpath)
# 2. app.mainclass= → app.mainmodule=beast.pkgmgmt/ (module-path launch)
-# 3. Inject --module-path=$APPDIR and --add-modules=ALL-MODULE-PATH into [JavaOptions]
-# so module descriptors (provides/requires) resolve at runtime.
+# 3. Inject --module-path=$APPDIR and --add-modules=ALL-MODULE-PATH (plus the
+# JavaFX + jdk.jsobject modules) into [JavaOptions] so module descriptors
+# (provides/requires) resolve at runtime.
# $APPDIR is jpackage's own placeholder; the native launcher resolves it at runtime.
+# JavaFX and jdk.jsobject MUST be named explicitly: the JavaFX JARs are not on the
+# module path (they were excluded from staging) — they come from the bundled JRE+FX
+# as platform modules, which ALL-MODULE-PATH does not pull in. The launcher loads
+# beast.fx as a plugin ModuleLayer; beast.fx requires javafx.graphics/controls, so
+# without these the GUI apps fail module resolution and never open a window.
echo ""
echo "==> Step 5: Patching .cfg files to module-path mode..."
for cfg in "$BUNDLE/app/"*.cfg; do
sed -i \
-e '/^app\.classpath/d' \
-e 's|^app\.mainclass=\(.*\)|app.mainmodule=beast.pkgmgmt/\1|' \
- -e '/^\[JavaOptions\]/a java-options=--module-path=$APPDIR\njava-options=--add-modules=ALL-MODULE-PATH' \
+ -e '/^\[JavaOptions\]/a java-options=--module-path=$APPDIR\njava-options=--add-modules=ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject' \
"$cfg"
done
diff --git a/release/Windows/bat/applauncher.bat b/release/Windows/bat/applauncher.bat
index 5000135..40b6720 100644
--- a/release/Windows/bat/applauncher.bat
+++ b/release/Windows/bat/applauncher.bat
@@ -2,6 +2,6 @@
set "BUNDLE_HOME=%~dp0.."
"%BUNDLE_HOME%\runtime\bin\java.exe" ^
--module-path "%BUNDLE_HOME%\app" ^
- --add-modules ALL-MODULE-PATH ^
+ --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject ^
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 ^
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher %*
\ No newline at end of file
diff --git a/release/Windows/bat/beast.bat b/release/Windows/bat/beast.bat
index 0b8cfa1..e503399 100644
--- a/release/Windows/bat/beast.bat
+++ b/release/Windows/bat/beast.bat
@@ -2,6 +2,6 @@
set "BUNDLE_HOME=%~dp0.."
"%BUNDLE_HOME%\runtime\bin\java.exe" ^
--module-path "%BUNDLE_HOME%\app" ^
- --add-modules ALL-MODULE-PATH ^
+ --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject ^
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 ^
-m beast.pkgmgmt/beast.pkgmgmt.launcher.BeastLauncher %*
diff --git a/release/Windows/bat/beauti.bat b/release/Windows/bat/beauti.bat
index a18a6c6..12b19ac 100644
--- a/release/Windows/bat/beauti.bat
+++ b/release/Windows/bat/beauti.bat
@@ -2,6 +2,6 @@
set "BUNDLE_HOME=%~dp0.."
"%BUNDLE_HOME%\runtime\bin\java.exe" ^
--module-path "%BUNDLE_HOME%\app" ^
- --add-modules ALL-MODULE-PATH ^
+ --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject ^
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 ^
-m beast.pkgmgmt/beast.pkgmgmt.launcher.BeautiLauncher -capture %*
\ No newline at end of file
diff --git a/release/Windows/bat/loganalyser.bat b/release/Windows/bat/loganalyser.bat
index 9d9a068..10a447c 100644
--- a/release/Windows/bat/loganalyser.bat
+++ b/release/Windows/bat/loganalyser.bat
@@ -2,6 +2,6 @@
set "BUNDLE_HOME=%~dp0.."
"%BUNDLE_HOME%\runtime\bin\java.exe" ^
--module-path "%BUNDLE_HOME%\app" ^
- --add-modules ALL-MODULE-PATH ^
+ --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject ^
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 ^
-m beast.pkgmgmt/beast.pkgmgmt.launcher.AppLauncherLauncher beastfx.app.tools.LogAnalyser %*
\ No newline at end of file
diff --git a/release/Windows/bat/logcombiner.bat b/release/Windows/bat/logcombiner.bat
index c944ec4..a0ab36e 100644
--- a/release/Windows/bat/logcombiner.bat
+++ b/release/Windows/bat/logcombiner.bat
@@ -2,6 +2,6 @@
set "BUNDLE_HOME=%~dp0.."
"%BUNDLE_HOME%\runtime\bin\java.exe" ^
--module-path "%BUNDLE_HOME%\app" ^
- --add-modules ALL-MODULE-PATH ^
+ --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject ^
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 ^
-m beast.pkgmgmt/beast.pkgmgmt.launcher.LogCombinerLauncher %*
\ No newline at end of file
diff --git a/release/Windows/bat/packagemanager.bat b/release/Windows/bat/packagemanager.bat
index 45f97aa..a2292f3 100644
--- a/release/Windows/bat/packagemanager.bat
+++ b/release/Windows/bat/packagemanager.bat
@@ -2,6 +2,6 @@
set "BUNDLE_HOME=%~dp0.."
"%BUNDLE_HOME%\runtime\bin\java.exe" ^
--module-path "%BUNDLE_HOME%\app" ^
- --add-modules ALL-MODULE-PATH ^
+ --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject ^
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 ^
-m beast.pkgmgmt/beast.pkgmgmt.PackageManager %*
\ No newline at end of file
diff --git a/release/Windows/bat/treeannotator.bat b/release/Windows/bat/treeannotator.bat
index 5599aa5..6b9fe94 100644
--- a/release/Windows/bat/treeannotator.bat
+++ b/release/Windows/bat/treeannotator.bat
@@ -2,6 +2,6 @@
set "BUNDLE_HOME=%~dp0.."
"%BUNDLE_HOME%\runtime\bin\java.exe" ^
--module-path "%BUNDLE_HOME%\app" ^
- --add-modules ALL-MODULE-PATH ^
+ --add-modules ALL-MODULE-PATH,javafx.controls,javafx.fxml,javafx.swing,javafx.web,jdk.jsobject ^
-Xss256m -Xmx8g -Duser.language=en -Dfile.encoding=UTF-8 ^
-m beast.pkgmgmt/beast.pkgmgmt.launcher.TreeAnnotatorLauncher %*
\ No newline at end of file
diff --git a/version.xml b/version.xml
index 8656341..2ac3aa5 100644
--- a/version.xml
+++ b/version.xml
@@ -312,139 +312,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-