Glue42 Enterprise is now io.Connect Desktop! The new documentation site for all products is located at

How to...


The Glue42 Java library provides an easy way to make your enterprise Java apps Glue42 enabled. You can use the Glue42 Java library in the same way as any standard Java library.

The Glue42 Java library is available as a package in the Maven Central Repository and as a part of the Glue42 Enterprise installer. It is highly recommended to use the shaded version of the library from the java-glue42-shaded artifact.

Glue42 Java requires JDK 8+ (Java SE 8+) and is JDK 9+ ready.

For Glue42 Java to work with Java SE 17+, you must pass the following parameters to the JVM:

--add-opens java.desktop/java.awt=ALL-UNNAMED
--add-opens java.desktop/
--add-exports java.desktop/java.awt.peer=ALL-UNNAMED


<?xml version="1.0" encoding="utf-8"?>
<project xmlns=""





apply plugin: 'java'

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    compile 'com.glue42:java-glue42-shaded:1.4.14'

Referencing & Initialization

To use Glue42 Java in your apps, add the Glue42 Java library and its dependencies to your app classpath, import the Glue class and create a Glue instance.

The following example demonstrates how to initialize the Glue42 Java library and access information about the Glue42 version, environment and region:

import com.tick42.glue.Glue;

try (Glue glue = Glue.builder().build())
    // Print out the Glue42 version.

    // Print out the Glue42 environment.

    // Print out the Glue42 region.

Glue is the main entry point of the SDK. It is thread-safe and you should create a single instance (per Glue42 app) and share it throughout your code.

Always close the Glue instance once you are done with it, in order to free up underlying resources (ws connections, thread pools, etc.). This example uses a try-with-resources block, because Glue extends AutoCloseable - in a real app, you will probably call close() or closeAsync() explicitly.

App Shutdown

Available since Glue42 Enterprise 3.10

When initializing Glue42, you can pass an event listener that will notify your app when it is about to be stopped. This is useful when your app/process isn't started directly by Glue42, but rather by Glue42 invoking a script/batch file or another app that in turn starts your app. With this listener you can properly shut down your app, free resources, etc.

Below is an example of passing a shutdown request listener when initializing Glue42:

        .withShutdownRequestListener(glue -> {
            System.out.println("Starting shutdown procedure...");

App Configuration

To configure your Glue42 enabled Java app and add it to the Glue42 Toolbar, you can use CONF, PROPERTIES, JSON files and system properties to externalize your configuration. For example, if you want to specify a name for your app, you can do so in a glue.conf file:

glue {
    application: "My Java App"

Glue42 Java will look for a Glue42 configuration file in the app classpath. If you are using Maven or Gradle as a build tool, you can place the glue.conf file for your app in the \src\main\resources folder of your project directory.

If you don't specify an app name in a glue.conf file, as in the example above, the name of the app will be taken from the Glue42 Enterprise starting context which contains app configurations from JSON files.

You can also set the app name runtime when initializing the Glue42 Java library, which will override any previous configurations:

Glue.builder().withApplicationName("My Java App").build();

JSON app configuration files must be placed in the %LocalAppData%\Tick42\UserData\<ENV>-<REG>\apps folder, where <ENV>-<REG> must be replaced with the environment and region of your Glue42 Enterprise copy (e.g., T42-DEMO).

The following is an example JSON configuration for a Java app:

        "title": "Java Example",
        "type": "exe",
        "name": "java-example",
        "icon": "",
        "details": {
            "path": "",
            "command": "java",
            "parameters": "-jar example.jar",
            "mode": "tab"

Note that if you want to pass parameters to the JVM - e.g., to ensure compatibility of Glue42 Java with Java SE 17+ (see Installation), you must pass them before the command for running the executable JAR file - e.g., before "-jar example.jar".

Property Description
"type" Must be "exe".
"path" The path to the app - relative or absolute.
"command" The actual command to execute (java).
"parameters" Specifies command line arguments.

To be able to start Glue42 Java on a dual core machine, you have to pass the parameter to the JVM by adding it to the "parameters" property described above.

For more details, see the Developers > Configuration > Application section.

Glue42 Java Concepts

Once you have created a Glue instance, your app has access to all Glue42 functionalities. For more detailed information on the different Glue42 concepts and APIs, see: