Launching a GUI app from the command line is not convenient at all. Native mac app earlier. One option is to assemble the.app package using Launch4j. However, I didn't have enough patience to do apply the tool. So I tried looking for an alternative solution. So I found this guide: Packaging a Java App for Distribution on a Mac. And the instructions worked just fine! Bundlers To list the bundlers that are available: javapackager -help bundlers To list the preferred set of bundler arguments for a particular bundler: javapackager -help Example 1: javapackager -help bundlers dmg - DMG Installer - INSTALLER mac.appStore - Mac App Store Ready Bundler - INSTALLER mac.app - Mac Application Image. Native packaging was first introduced as a part of the JavaFX 2.2 SDK enabling you to package an application as a native bundle and then installing and running the application without any external dependencies on a system JRE or JavaFX SDK. Next it became usable for Java SE projects as well.
Shell script to package java code as a native OS X application.
package.sh
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment
Summary
Create a tool for packaging self-contained Java applications.
Goals
Create a simple packaging tool, based on the JavaFX
javapackager tool, that:
Non-Goals
Motivation
Many Java applications need to be installed on a native platform in a first-class way, rather than simply being placed on the class path or the module path. It is not sufficient for the application developer to deliver a simple JAR file; they must deliver an installable package suitable for the native platform. This allows Java applications to be distributed, installed, and uninstalled in a manner that is familiar to users. For example, on Windows users expect to be able to double-click on a package to install their software, and then use the control panel to remove the software; on macOS, users expect to be able to double-click on a DMG file and drag their application to the Application folder.
Java Package Create Mac App Free
A packaging tool can also help fill gaps left by other technologies such as Java Web Start, which was removed from Oracle’s JDK 11, and
pack200 , which was deprecated in JDK 11 for removal in a future release. Developers can use jlink to strip the JDK down to the minimal set of modules that are needed, and then use the packaging tool to produce a compressed, installable image that can be deployed to target machines.
To address these requirements previously, a packaging tool called
javapackager was distributed with Oracle’s JDK 8. However, it was removed from Oracle’s JDK 11 as part of the removal of JavaFX.
Description
The
jpackage tool packages a Java application into a platform-specific package that includes all of the necessary dependencies. The application may be provided as a collection of ordinary JAR files or as a collection of modules. The supported platform-specific package formats are: 3d chess game free download full version for windows 8.
![]()
By default,
jpackage produces a package in the format most appropriate for the system on which it is run.
Basic usage: Non-modular applications
Suppose you have an application composed of JAR files, all in a directory named
lib , and that lib/main.jar contains the main class. Then the command Todo cloud mac app.
will package the application in the local system's default format, leaving the resulting package file in the current directory. If the
MANIFEST.MF file in main.jar does not have a Main-Class attribute then you must specify the main class explicitly:
The name of the package will be
myapp , though the name of the package file itself will be longer, and end with the package type (e.g., myapp.exe ). The package will include a launcher for the application, also called myapp . To start the application, the launcher will place every JAR file that was copied from the input directory on the class path of the JVM.
If you wish to produce a package in a format other than the default, then use the
--type option. For example, to produce a pkg file rather than dmg file on macOS:
Basic usage: Modular applications
If you have a modular application, composed of modular JAR files and/or JMOD files in a
lib directory, with the main class in the module myapp , then the command
will package it. If the
myapp module does not identify its main class then, again, you must specify that explicitly:
(When packaging a modular JAR or a JMOD file you can specify the main class with the
--main-class option to the jar and jmod tools.)
Package metadata
The
jpackage tool allows you to specify various kinds of metadata for your package. The options common to all platforms are:
The tool uses the arguments provided to these options in the manner appropriate to the package's type. Platform-specific package metadata options are described below.
File associations
You can define one or more file-type associations for your application via the
--file-associations option, which can be used more than once. The argument to this option is a properties file with values for one or more of the following keys:
Java Package Create Mac App Download
Launchers
By default, the
jpackage tool creates a simple native launcher for your application. You can customize the default launcher via the following options:
If your application requires additional launchers then you can add them via the
--add-launcher option:
The named
<file> should be a properties file with values for one or more of the keys app-version icon arguments java-options main-class main-jar module , or win-console . The values of these keys will be interpreted as arguments to the options of the same name, but with respect to the launcher being created rather than the default launcher. The --add-launcher option can be used multiple times.
Application images
The
jpackage tool constructs an application image as input to the platform-specific packaging tool that it invokes in its final step. Normally this image is a temporary artifact, butsometimes you need to customize it before it's packaged. You can, therefore, run the jpackage tool in two steps. First, create the initial application image with the special package type app-image :
This will produce an application image in the
myapp directory. Customize that image as needed, and then create the final package via the --app-image option:
Runtime images
An application image contains both the files comprising your application as well as the JDK runtime image that will run your application. By default, the
jpackage tool invokes thethe jlink tool to create the runtime image. The content of the image depends upon the type of the application:
In either case, if you want additional modules to be added to the runtime image you can use the
--add-modules option with the jpackage tool. The list of modules in a runtime image is available in the image's release file.
Runtime images created by the
jpackage tool do not contain debug symbols, the usual JDK commands, man pages, or the src.zip file.
If you wish to customize the runtime image further then you can invoke
jlink yourself and pass the resulting image to the jpackage tool via the --runtime-image option. For example, if you've used the jdeps tool to determine that your non-modular application only needs the java.base and java.sql modules, you could reduce the size of your package significantly:
Platform-specific details
This section describes the platform-specific aspects of the
jpackage tool, including application image layouts and platform-specific options. How to download talisman mac. The command jpackage --help will print a summary of all options.
The application images created by the
jpackage tool contain some files not shown in the layouts below; such files should be considered implementation details that are subject to change.
Linux
The default installation directory on Linux is
/opt . This can be overridden via the --install-dir option.
Linux-specific options:
macOS
The default installation directory on macOS is
/Applications . This can be overridden via the --install-dir option.
macOS-specific options:
Windows
The default installation directory on Windows is
C:/Program Files/ .This can be overridden via the --install-dir option.
Hp cd writer software download. Windows-specific options:
Delivering
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |