You can use the example Swing application as a USB License Dongle Creator.
Just change the product hash value in License.getInstance().getBuilder() line in MainJFrame.java file. It will connect to the license server and validate/activate the license; then will write to the USB. USB License Dongle can be used in offline environments
See the licensing library details at https://www.license4j.com/documents/java-licensing-library/usb-license-dongle/

