While there are some alternatives, license4j should meet your requirements. Please refer to this quick start page and the examples available on github.com/license4j.