How to license and sell a Java application
Add the Maven SDK, enforce that each key belongs to this product, handle signed offline grace, and sell the application from the same platform.
dev.permitcore:permitcore-sdk:1.1.0
import dev.permitcore.PermitClient;
PermitClient client = new PermitClient(
"https://api.permitcore.dev"
);
var result = client.validate(
licenseKey,
appVersion,
productId
);
if (!result.isValid)
showActivationDialog(result.message);From product record to paid customer
Use PermitCore for the licensing layer and the sale. Your customer checks out in your branded Store and receives a working license automatically.
- 01Create
Create the product and license policy
In Products, create the software your key unlocks. Choose its activation limit, validity, offline grace period, version range, and feature flags.
- Create the Java desktop product
- Set activation and version boundaries
- Choose an offline grace period
- Copy the product ID
- 02Implement
Install the Java SDK and scope the key
Put license activation in the first-run flow and validation at startup. Pass your product ID so a valid key for another product cannot unlock this one.
dev.permitcore:permitcore-sdk:1.1.0- Add the 1.1.0 Maven dependency
- Activate on the first installation
- Validate on later launches
- Pass expectedProductId to every check
- 03Verify
Test the real validation path
Validate a real test key, then simulate a network outage after a successful online response. With offline grace configured, the SDK re-verifies the signed cached token locally and marks the result as offline.
- 04Sell
Publish the product in your Store
Connect your Stripe account, add the product to your branded PermitCore Store, and publish. Checkout creates the license and delivers it to the customer without a webhook project or a second commerce platform.
- Create a Store listing for the build
- Choose Stripe pricing
- Publish the branded checkout
- Confirm automatic license delivery
One checkout completes the sale and delivers the license.
Java production checklist
The sample is intentionally small. Add these safeguards before making licensing part of a paid release.
- Run activation work away from the Swing or JavaFX UI thread.
- Treat a signed offline-grace result as temporary and show its state.
- Test minimum and maximum version enforcement against actual release versions.
- Keep the product ID configurable per edition while keeping Admin credentials server-side.