// For complete examples and data files, please go to https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java
try {
// Obtain license stream
FileInputStream licenseStream = new FileInputStream(filePath);
// Setup license
License lic = new License();
lic.setLicense(licenseStream);
} catch (Exception exp) {
System.out.println("Exception: " + exp.getMessage());
exp.printStackTrace();
}