I am bundling an app using javapackager
wherein the main jar is a module with a module-info.class but it relies on many other jars that are plain old jars, so I call them out as automatic modules in module-info.java. However, javapackager
complains about not being able to find them. How do I make it find the jar files for automatic modules?
Exception: jdk.tools.jlink.plugin.PluginException: java.lang.module.FindException: Module rcf not found, required by com.username.commander.ui
Exception in thread "main" com.sun.javafx.tools.packager.PackagerException: Error: Bundler "Mac Application Image" (mac.app) failed to produce a bundle.
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateNativeBundles(PackagerLib.java:374)
at jdk.packager/com.sun.javafx.tools.packager.PackagerLib.generateDeploymentPackages(PackagerLib.java:348)
at jdk.packager/com.sun.javafx.tools.packager.Main.main(Main.java:496)
I have tried specifying the module path (first dir has just the main module jar, second dir has all the non-module jars):
/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/javapackager -deploy -native image
-name Commander -title Commander -vendor "username"
--module-path /Users/username/Dropbox/coding/commander/Commander-java/moduleJars:/Users/username/Dropbox/coding/commander/Commander-java/packageJars
--module com.username.commander.ui/com.username.commander.ui.AppWindow
-srcdir /Users/username/Dropbox/coding/commander/Commander-java/packageJars
-outdir /Users/username/Dropbox/coding/commander/Commander-java/target
-outfile Commander
-Bruntime=target/jre-9.0.1 -Bicon=src/main/resources/icons/commander.icns
-BappVersion=1.0
-Bmac.CFBundleIdentifier=com.username.Commander
--add-modules java.base,java.desktop,java.naming,java.sql,java.xml,java.logging,java.management,java.scripting,java.compiler,java.rmi,java.activation
--limit-modules java.base,java.desktop,java.naming,java.sql,java.xml,java.logging,java.management,java.scripting,java.compiler,java.rmi,java.activation
-nosign -v
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…