Using the jpackager
Lennart Börjeson
lenborje at gmail.com
Fri Nov 9 15:08:40 UTC 2018
You're thinking of the "HelloWorld.exe" example? That's not really informative, since it doesn't specify how to create the contents of the directory, nor the layout of the levels below app/ and runtime/.
I have a runnable jar, let's call it APP.jar.
If I try the naive: jpackager create-image -o out -j APP.jar
Error messages:
Bundler Mac Application Image skipped because of a configuration problem: The configured main jar does not exist APP.jar
Advice to fix: The main jar must be specified relative to the app resources (not an absolute path), and must exist within those resources.
OK, let's do that. Put the jar in an "input dir": jpackager create-image -o out -i in -j APP.jar
Error messages:
Creating app bundle: /Users/lennartb/App/out/App.app
"Adding modules: [] to runtime image."
Exception: jdk.tools.jlink.plugin.PluginException: java.io.IOException: jdk.tools.jlink.plugin.PluginException: ModuleTarget attribute is missing for java.base module
Error: Bundler "Mac Application Image" (mac.app) failed to produce a bundle.
I have of course tried a lot of other things, but I'd really like some pointers here...
Best regards,
/Lennart
> 9 nov. 2018 kl. 15:17 skrev Nir Lisker <nlisker at gmail.com>:
>
> There are some instructions in the JEP [1]. They show how to create a dmg.
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8200758?focusedCommentId=14217780&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14217780
>
> On Fri, Nov 9, 2018 at 4:06 PM Lennart Börjeson <lenborje at gmail.com> wrote:
> I've been trying to understand how to use the jpackager, but I'm stumped.
>
> I have for a long been using the now defunct gradle-javafx plugin, so I've never really used the old javapackager either, only indirectly through gradle.
>
> So I'm maybe asking terribly noob questions, but here goes:
>
> Let's say I have a non-modular application packaged as an executable jar, i.e. a GUI I can launch with the "java -jar" command: How can I package this as a native application/dmg with jpackager?
>
> On a more general note: What's the required layout/contents of the "input directory"?
>
>
> Best regards,
>
> /Lennart Börjeson
More information about the openjfx-dev
mailing list