Excelsior JET API

The Excelsior JET API enables easy integration with (Java) build tools such as Maven and Gradle.

License

License

GroupId

GroupId

com.excelsiorjet
ArtifactId

ArtifactId

excelsior-jet-api
Last Version

Last Version

1.3.3
Release Date

Release Date

Type

Type

jar
Description

Description

Excelsior JET API
The Excelsior JET API enables easy integration with (Java) build tools such as Maven and Gradle.
Project URL

Project URL

https://github.com/excelsior-oss/excelsior-jet-api
Source Code Management

Source Code Management

https://github.com/excelsior-oss/excelsior-jet-api

Download excelsior-jet-api

How to add to project

<!-- https://jarcasting.com/artifacts/com.excelsiorjet/excelsior-jet-api/ -->
<dependency>
    <groupId>com.excelsiorjet</groupId>
    <artifactId>excelsior-jet-api</artifactId>
    <version>1.3.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.excelsiorjet/excelsior-jet-api/
implementation 'com.excelsiorjet:excelsior-jet-api:1.3.3'
// https://jarcasting.com/artifacts/com.excelsiorjet/excelsior-jet-api/
implementation ("com.excelsiorjet:excelsior-jet-api:1.3.3")
'com.excelsiorjet:excelsior-jet-api:jar:1.3.3'
<dependency org="com.excelsiorjet" name="excelsior-jet-api" rev="1.3.3">
  <artifact name="excelsior-jet-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.excelsiorjet', module='excelsior-jet-api', version='1.3.3')
)
libraryDependencies += "com.excelsiorjet" % "excelsior-jet-api" % "1.3.3"
[com.excelsiorjet/excelsior-jet-api "1.3.3"]

Dependencies

compile (2)

Group / Artifact Type Version
org.codehaus.plexus : plexus-utils jar 3.0.8
org.apache.commons : commons-compress jar 1.10

test (4)

Group / Artifact Type Version
junit : junit jar 4.8.2
org.mockito : mockito-all jar 2.0.2-beta
org.powermock : powermock-api-mockito jar 1.6.5
org.powermock : powermock-module-junit4 jar 1.6.5

Project Modules

There are no modules declared in this project.

Maven Central Excelsior JET Java API

The common part of Excelsior JET Maven and Gradle plugins. Though we have no plans to provide plugins for other build tools such as ANT or SBT at this point, you can use this API to write your own plugin for those build tools or for your own build tool, so as to automate your Excelsior JET builds.

Usage and classes overview

When writing your own Excelsior JET plugin for a build system of your choice, you will most likely use the following three classes:

JetProject

JetProject is essentially a collection of Excelsior JET compiler and packager parameters that configure a build of a Java project with Excelsior JET.

So first, you need to create an instance of JetProject, the constructor of which has the following arguments:

  • projectName - name of the project

  • groupId - project group id. Unique identifier that can be shared by multiple projects. Usually a reverse domain name is used as a group id, such as "com.example".

  • version - project version

  • appType - application type. Four types of applications are currently supported:

    • PLAIN - Plain Java SE applications, i.e. applications that have a main class and have all their dependencies explicitly listed in the JVM classpath at launch time, and
    • TOMCAT - Tomcat Web applications.war files that can be deployed to the Apache Tomcat application server.
    • DYNAMIC_LIBRARY - Invocation Dynamic Libraries, (e.g. Windows DLLs) callable from applications written in non-JVM languages via the Invocation API.
    • WINDOWS_SERVICE - Windows Services, special long-running processes that may be launched during operating system bootstrap (Windows only) and use the Excelsior WinService API.
  • targetDir - target build directory

  • jetResourcesDir - directory that contains Excelsior JET specific resource files such as application icons, installer splash, etc.

All the above parameters are required and cannot be null.

Then you set other parameters via JetProject build pattern methods, such as .mainClass(ProjectMainClass) and .dependencies(ProjectDependencies) for PLAIN Java SE applications.

JetBuildTask

Once you have configured a JetProject instance, you may build it with JetBuildTask that has the only method execute(). So the sketch of your plugin will look like this: (taken from the Maven plugin):

    JetProject jetProject = new JetProject(project.getArtifactId(), project.getGroupId(), project.getVersion(),
                                        getAppType(), targetDir, jetResourcesDir)
                                .jetHome(jetHome)
                                .mainClass(mainClass)
                                .dependencies(getArtifacts())
                                //.anotherConfigParameter(...)
                                //.anotherConfigParameter(...)
    ;
    new JetBuildTask(jetProject).execute();

The native build is performed in the jet subdirectory of the targetDir project parameter. First, the task copies the main application jar to the jet/build directory, and copies all its run time dependencies to jet/build/lib. Then it invokes the Excelsior JET AOT compiler to compile all those jars into a native executable. Upon success, it copies that executable and the required Excelsior JET Runtime files into the jet/app directory, binds the executable to that copy of the Runtime, and copies the contents of the directory to which the packageFilesDir project parameter points recursively to jet/app.

Your natively compiled application is ready for distribution at this point: you may copy the contents of the jet/app directory to another computer that has neither Excelsior JET nor the Oracle JRE installed, and the executable should work as expected.

Finally, the task packs the contents of the jet/app directory into a zip archive named ${artifactName}.zip so as to aid single file re-distribution. On Windows and Linux, you can also set the excelsiorJetPackaging parameter to excelsior-installer to have the task create an Excelsior Installer setup instead, and on OS X, setting excelsiorJetPackaging to osx-app-bundle will result in the creation of an application bundle and, optionally, a native OS X installer package (.pkg file).

TestRunTask

Before compiling the application with Excelsior JET, it can be useful to run it on the Excelsior JET JVM using a JIT compiler. This so-called Test Run helps Excelsior JET:

  • verify that your application can be executed successfully on the Excelsior JET JVM. Usually, if the Test Run completes normally, the natively compiled application also works well.
  • detect the optional parts of the Excelsior JET Runtime that are used by your application.
  • collect profile information to optimize your app more effectively. The profiles will be used by the Startup Optimizer and the Global Optimizer.

To provide a Test Run for your plugin you may use TestRunTask that takes a JetProject instance in its constructor and provides the execute() method that performs a Test Run.

com.excelsiorjet

Excelsior LLC

We make Excelsior JET, a compliant Java SE JVM with AOT compiler. These are our open source projects.

Versions

Version
1.3.3
1.3.1
1.3.0
1.2.0
1.1.2
1.1.0
1.0.0
0.9.5
0.9.4
0.9.3
0.9.1
0.9.0
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.2.0
0.1.0