You can use the example Swing application as a USB License Dongle Creator. Just change the "License Builder" lines. Use exactly the same builder code as in your software. It will connect to the license server and validate/activate the license; then will write to the USB. See the licensing library details at https://www.license4j.com/documents/licensing-library/usb-license-dongle/