#1
Posted
:
Monday, February 13, 2017 4:56:16 PM(UTC)
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.
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.