bright, fresh software
Downloads  |  Buy

Using TurboActivate with Java

Before you can do anything you need to login to your LimeLM account (or sign up). Then download TurboActivate for Windows, Mac OS X, or Linux:

Adding licensing & online activation to your appTurboActivate.dat and Version GUID

After you've created a new product, go to the version page of the product you will be adding licensing to. You will need to do 2 things:

  1. Download the TurboActivate.dat file for the product version.
  2. Make a note of the Version GUID.

You'll be including the TurboActivate.dat file in a "TurboActivate" folder we'll talk about later and you'll use the Version GUID in your code as part of integrating TurboActivate within your app.

Example project

Included in is a simple example project. The project was created with NetBeans, but you should be able to open it with other IDEs with minimal effort.

The folder API/Java/src/turboactivate contains all the classes you'll need to add licensing, online-activation, and trial functionality to your app.

JNA (Java Native Access)

The TurboActivate Java classes make use of JNA (Java Native Access). Simply put, JNA is a free library that allows easy access to native libraries (*.dll on Windows, *.dylib on Mac OS X, *.so on Unix) without writing anything but Java code. The best part is we've written native libraries for all major Operating Systems and the accompanying Java code to use it. All you need to do is add the files to your product.

TurboActivate binaries for Windows, Mac, and Linux

TurboActivate is compiled as a native binary. This means you will need to include the native TurboActivate binaries for every platform you want to support.

The Java TurboActivate package looks for the native platform libraries in the folder "TurboActivate" relative to your .jar file. For instance:




If you're creating platform specific installers then you don't need to include the versions of TurboActivate not applicable to that platform. In other words, if you're releasing your Java app to Windows and to Mac you will likely create a separate installer for each platform.

If you only include the platform specific TurboActivate binaries you will reduce the size of your initial distribution.


You must set the TurboActivate.VersionGUID property before you use any TurboActivate functions. We recommend you set the VersionGUID property when your application first loads. You only need to set it once:

TurboActivate.VersionGUID = "Version GUID you copied earlier";

IsActivated(), IsGenuine(), IsGenuineEx()

There are 3 separate TurboActivate functions for checking whether a customer is activated or not:

For most cases we recommend using IsGenuineEx(). For example:

boolean isActivated;
IsGenuineResult gr;

    // "SetPDetsLocation" loads the TurboActivate.dat file from
    // the "TurboActivate" folder relative to this Jar

    // Check if we're activated, and every 90 days verify it with
    // the activation servers. In this example we won't show an
    // error if the activation was done offline
    // (see the 3rd parameter of the IsGenuine() function)
    gr = TurboActivate.IsGenuine(90, 14, true, false);

    isActivated = gr == IsGenuineResult.Genuine ||
                  gr == IsGenuineResult.GenuineFeaturesChanged ||

                  // an internet error means the user is activated but
                  // TurboActivate failed to contact the LimeLM servers
                  gr == IsGenuineResult.InternetError;
catch (TurboActivateException ex)
    //TODO: handle exceptions
                   "Failed to check if activated: " + e.getMessage());

if (isActivated)
    // your app is activated and genuine

    if (gr == IsGenuineResult.InternetError)
        //TODO: give the user the option to retry the genuine checking
        //      immediately. For example a dialog box. In the dialog
        //      call IsGenuine() to retry immediately.
    // TODO: Not genuine or not activated. Either way you should either
    // restrict the user from using your app or give the user a trial
    // of your app.

UseTrial(), TrialDaysRemaining()

The UseTrial() function starts and/or revalidates the trial. The TrialDaysRemaining() function returns the number of days remaining in the trial. When TrialDaysRemaining() returns 0 you should disable your apps features and require them to activate. See the example project.

Note: Always call UseTrial() before calling TrialDaysRemaining().

if (isActivated)
    // your app is activated and genuine, see above
    // not genuine / not activated


    if (TurboActivate.TrialDaysRemaining() == 0)
        //TODO: disable the features of your app
        // trial days remaining

Learn more about using trials & trial extensions to win over prospective customers.

TurboActivate wizardActivating your product

We recommend you use the TurboActivate.exe for entering product keys and activating your product. In the example project we show how to launch TurboActivate.exe and then check if the user is activated after it closes.

If you want to build your own interface then just use the CheckAndSavePKey(String pkey) and Activate() functions.