JApplication is a task for assembling native launchers of Java applications for a number of target platforms. Currently supports native launchers for Mac and Windows operating systems and also a "java launcher" - a single jar file that can be run via
"java -jar file.jar".
- Java: builds a single runnable jar file out of a collection of jar files.
- Mac: builds a XYZ.app bundle that includes all jar dependencies.
- Windows: Performs a Java build and creates an NSIS launcher for the runnable jar. Both
".jar"files are required to be in the same directory for the launcher to work.
- Mac launcher can be built on Mac only, as it requires a JavaApplicationStab file.
- Windows launcher can be built on Windows only.
- Java launcher can be assembled on any platform and has no prerequisites.
The name of the application without OS-specific extension
Main Java class
A family of operating systems. Currently supported values are "mac", "windows" and "java"
no (will use build machine os if ommitted; if the os is not supported, will use "java")
A destination directory where the application launcher should be installed
no (will use
An optional string identifying the application human-readable name. If not specified, "name" is used.
Platform-specific icon file (usually "*.ico" on Windows and "*.icns" on Mac)
Minimal version of the Java Virtual machine required.
no (default is "1.4+")
Optional parameters to pass to the JVM, such as memory settings, etc.
Product version string
no (default 0.0)
The FileSet specifying jar files to be included in the application.
<taskdef name="japplication" classname="org.objectstyle.woproject.ant.JApplication"/>
Building a Windows application, resulting in "MyApp.exe" launcher that starts "MyApp.jar" file.
<japplication name="MyApp" destDir="dist" mainClass="org.example.Main" os="windows"> <lib dir="lib" includes="**/*.jar"/> </japplication>