Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, February 13, 2017 4:56:16 PM(UTC)
Nick Villalobos

Groups: Registered
Posts: 119

Was thanked: 4 time(s) in 4 post(s)

Below you will find a code snippet of how to set a runtime license using LEADTOOLS 20 Java SDK. The first step you will want to do is set your lib path to the location where the CDLLVC10 file are located, then load the necessary libraries needed for your application.

Once that is set, you can now call RasterSupport.setLicense(license path, developer key); Those two files should be located, by default, here for Windows: C:\LEADTOOLS 20\Common\License or emailed to you if you're working on Linux

Code:

public static boolean loadLibraries() {
    try {
        // Set the path to the libs

        //Windows
        Platform.setLibPath("C:\\LEADTOOLS 20\\Bin\\CDLLVC10\\x64");

        //Linux
        Platform.setLibPath("<Path to the LEADTOOLS directory>/LEADTOOLS20/Bin/Lib/x64");

        // Load in the necessary libraries
        Platform.loadLibrary(LTLibrary.LEADTOOLS);

        String licensePath = "Path to the developer license file";
        String developerKey = "Developer key";

        // Set your license
        RasterSupport.setLicense(licensePath, developerKey);

        if (RasterSupport.getKernelExpired()) {
            System.out.println("License NOT Set Successfully");
            return false;
        } else {
            System.out.println("License Set Successfully");
            return true;
        }
    } catch (Exception ex) {
        ex.printStackTrace();
        return false;
    }
}

Edited by moderator Friday, June 1, 2018 8:53:33 AM(UTC)  | Reason: Updated to v20

Nick Villalobos
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.119 seconds.