Java API
SunLicenseAPI Integration Guide
Prerequisites
Java 8 or higher
SunLicense Server API URL
Product ID
Project Setup
1. Configure Maven Repository
Add the Sundevs repository to your pom.xml
:
2. Add Dependency
Include the SunLicenseAPI dependency in your pom.xml
:
Basic Integration
1. Initialize the API
Create an instance of SunLicenseAPI with your license details:
License Key cannot be hardcoded its different from license to license and you have to write a logic to take license key from a config file and pass as a parameter.
2. Implement License Validation
Add basic license validation to your application:
Advanced Configuration
Custom IP Address Configuration
You can manually set the IP address for validation:
Loading License from File
For production environments, load the license key from a file:
Custom HWID You can write your own implementation for HWID and pass it with the request.
Troubleshooting
Common issues and solutions:
Connection Issues
Verify API endpoint URL
Check network connectivity
Confirm firewall settings
Validation Failures
Verify license key format
Check product ID is correct
Confirm IP address restrictions
Configuration Problems
Ensure Java version compatibility
Check dependency versions
Remember to replace placeholder values (YOUR-LICENSE-KEY
, YOUR_PRODUCT_ID
, YOUR_API_URL
) with your actual values from your SunLicense account.
Last updated