You can use LicenseSpring for this:

Import The LicenseSpring SDK for Java into the applications you distribute, and use the vendor platform to configure / issue / manage licenses. The License...