How to...

Glue42 Enable Your App



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

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


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





apply plugin: 'java'

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencies {
    compile 'com.tick42.glue:tick42-glue-shaded:1.2.0.PREVIEW0'

Quick Start

import com.tick42.glue.Glue; 

try (Glue glue = Glue.builder().build()) 

In the example above:

  • First, import the Glue42 package.

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

  • Get the Glue42 version as a string.

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 application, you will probably call close() or closeAsync() explicitly.


To configure Glue42 Java, you can use .conf files, .properties files, .json files and system properties to externalize your configuration.

Here is an example of a minimal glue.conf file:

glue {
    application: "example"

Application Definition

To add your Java application to the Glue42 Desktop App Manager application, you need to define a configuration file and add it to the application config store. You can add the configuration file for your application in the %LocalAppData%\Tick42\UserData\<REG-ENV>\apps folder to publish your own application locally. <REG-ENV> in the link should be replaced with the region and environment folder name used for the deployment of your Glue42 Desktop - e.g., T42-DEMO. This way, your files will not be erased or overwritten, in case you decide to upgrade or change your Glue42 Desktop version.

Here is an example:

    "title": "Java Example",
    "type": "exe", 
    "name": "java-example",
    "icon": "",
    "details": {
      "path": "", 
      "command": "java", 
      "parameters": " -jar example.jar", 
      "mode": "tab"
  • type should be exe;
  • path is the path to the application - relative or absolute;
  • command is the actual command to execute (java);
  • parameters holds command line arguments;

Note that the definition should be a valid .json file (you should either use forward slash or escape the backslash).

For more detailed information about the application definitions, see the Configuration documentation.

You can also check out our Java examples at GitHub, demonstrating the various Glue42 Desktop features.