IRONSOFTWAREHOME

Applying License Keys in IronPDF for Java

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Applying a license key to IronPDF for Java unlocks full production capability. Without a valid license key, IronPDF runs in trial mode and stamps a watermark on every generated PDF (acceptable for development and evaluation) but not suitable for live deployment. This guide walks through three ways to apply a license key: in Java code at startup, via a config.properties file, and how to verify the key is active.

Quickstart: Apply an IronPDF License Key in Java

How Do You Get an IronPDF License Key?

IronPDF for Java is free to evaluate in development. In trial mode, every PDF produced carries an IronPDF watermark. To remove the watermark and deploy to production, a paid or trial license key is required.

Two options are available:

Once the key arrives by email, keep it available for the steps below. The same key works for code-based and file-based application methods.

How Do You Add IronPDF as a Java Dependency?

Before applying a license key, IronPDF must be on the classpath. There are two ways to achieve this: declare it as a Maven dependency or add the .jar file manually.

Option 1: Maven (pom.xml)

Add the following two entries to the <dependencies> block in your pom.xml. The first pulls in the IronPDF library; the second adds the SLF4J logger that IronPDF uses internally.

<dependencies>
    <!-- IronPDF for Java — use the latest release version -->
    <dependency>
        <groupId>com.ironsoftware</groupId>
        <artifactId>ironpdf</artifactId>
        <version>20xx.xx.xxxx</version>
    </dependency>

    <!-- SLF4J simple logger required by IronPDF -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>2.0.3</version>
    </dependency>
</dependencies>
XML

Replace 20xx.xx.xxxx with the latest IronPDF for Java version. After saving pom.xml, run mvn install (or let your IDE sync) to download the dependency.

Option 2: Manual JAR

If Maven is not part of the build toolchain, download the IronPDF Java .jar file and add it to the project's classpath manually. This approach suits Ant-based builds or projects that manage dependencies without a package manager.

How Do You Apply a License Key in Java Code?

The most direct method is to call License.setLicenseKey() at the very beginning of application startup, before any PDF operation runs. Placing the call in the main method is the safest approach.

import com.ironsoftware.ironpdf.License;

public class MyApplication {
    public static void main(String[] args) {
        // Apply your license key before using any IronPDF feature
        License.setLicenseKey("IRONPDF-MYLICENSE-KEY-1EF01");

        // IronPDF is now fully licensed — no watermarks on output PDFs
        System.out.println("IronPDF license applied.");
    }
}
Java

This approach works in all Java project types: standalone applications, Spring Boot services, Jakarta EE applications, and Android projects. The key is stored in memory for the lifetime of the JVM process; no file system writes occur.

How Do You Apply a License Key Through a Config File?

For projects that separate configuration from code, such as twelve-factor applications or deployments that rotate keys without a redeploy, the config.properties file method is preferable.

Add one line to config.properties:

IRONPDF_LICENSE_KEY=IRONPDF-MYLICENSE-KEY-1EF01
Text

Place the file in the working directory of the running application or on the classpath root. IronPDF reads this property automatically at startup. No code changes are required when the key changes; update the file and restart the process.

How Do You Verify That the License Key Is Active?

After applying a key by either method, License.isValidLicense() confirms whether IronPDF recognizes it as valid. Add this check to a startup routine or a health-check endpoint.

import com.ironsoftware.ironpdf.License;

public class LicenseVerification {
    public static void main(String[] args) {
        String licenseKey = "IRONPDF-MYLICENSE-KEY-1EF01";

        // Returns true if the key is valid and the license is active
        boolean isValid = License.isValidLicense(licenseKey);

        if (isValid) {
            System.out.println("License is valid — watermarks are disabled.");
        } else {
            System.out.println("License is invalid or expired. PDFs will include a trial watermark.");
        }
    }
}
Java

License.isValidLicense() returns true when the key format is correct, the license has not expired, and the key matches the product. It returns false for malformed keys, expired trial keys, or keys issued for a different Iron Software product. After any license change, clean and rebuild the project before running this check to avoid stale class data affecting the result.

IronPDF for Java: Trial vs. Licensed Behavior

BehaviorTrial Mode (no key)Licensed Mode
PDF watermarkYes, on every pageNo
Production deploymentNot permittedPermitted
Feature accessFull API availableFull API available
License.isValidLicense()Returns falseReturns true

What Are the Next Steps?

With a valid license key applied, IronPDF for Java is ready for production use. The following resources help move from setup to implementation:

For technical questions, the IronPDF support team is available via live chat and email.

Frequently Asked Questions

How can I apply an IronPDF license key in Java?

You can apply an IronPDF license key in Java by using License.setLicenseKey('YOUR-LICENSE-KEY') at the start of your application, or by setting IRONPDF_LICENSE_KEY=YOUR-LICENSE-KEY in a config.properties file.

What happens if I don't apply a license key in IronPDF for Java?

Without a valid license key, IronPDF operates in trial mode and applies a watermark on each generated PDF, which is not suitable for live deployment.

How do I verify if my IronPDF license key is active?

You can verify if your license key is active by using License.isValidLicense('YOUR-LICENSE-KEY'), which returns true if the key is valid.

Can I use IronPDF for Java without purchasing a license?

You can evaluate IronPDF for Java for free in trial mode, but a license is needed to deploy in production and remove watermarks.

What are the two ways to add IronPDF as a dependency in Java?

You can add IronPDF as a dependency by either adding it to your pom.xml file using Maven or by manually downloading the .jar file and adding it to your project's classpath.

What is the purpose of the config.properties file in IronPDF license application?

The config.properties file allows you to apply a license key without code changes, as IronPDF reads the license property automatically at startup.

What should I do if my license key is invalid?

Ensure that the key format is correct, the key is valid for IronPDF, and it has not expired. If issues persist, contact IronPDF support for assistance.

Does IronPDF for Java require any additional libraries?

Yes, when using Maven, IronPDF for Java requires the SLF4J simple logger, which must be added to the pom.xml.

Can I automate license key changes in a production environment?

Yes, by using a config.properties file, you can automate key changes without needing to modify the code and simply update the file as required.

How does the license key affect the behavior of IronPDF for Java?

A valid license key enables production deployment and removes PDF watermarks. In trial mode (without a key), watermarks are included, and production deployment is not permitted.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Version:2026.8just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
Java Maven Library for PDF
Install with Maven

Version: 2026.8

<dependency>
   <groupId>com.ironsoftware</groupId>
   <artifactId>ironpdf</artifactId>
   <version>2026.8.2</version>
</dependency>
https://central.sonatype.com/artifact/com.ironsoftware/ironpdf/2026.8.2
or
Java PDF JAR
Download JAR

Version: 2026.8

Manually install into your project

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

OR
bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required
Java Maven Library for PDF
Install with Maven

Version: 2026.8

<dependency>
   <groupId>com.ironsoftware</groupId>
   <artifactId>ironpdf</artifactId>
   <version>2026.8.2</version>
</dependency>
https://central.sonatype.com/artifact/com.ironsoftware/ironpdf/2026.8.2
or
Java PDF JAR
Download JAR

Version: 2026.8

Manually install into your project