Java System Properties
Quick Reference Guide


jdk.jar.maxSignatureFileSize Java System Property

The jdk.jar.maxSignatureFileSize java system property limits the maximum size of signature files in a signed JAR

Default Value

8000000 8mb

Overview of jdk.jar.maxSignatureFileSize

The jdk.jar.maxSignatureFileSize java system property specifies the maximum allowed size of signature files within a signed JAR file.

References

Supported Since

Java has supported the jdk.jar.maxSignatureFileSize system property since Java 7u391, 8u381, 11.0.20, 17.0.8, 20.0.2 and greater (via JDK-8300596).

Setting jdk.jar.maxSignatureFileSize on Startup

You can set the jdk.jar.maxSignatureFileSize java system property during startup of the java runtime using the -D command line argument:

java -Djdk.jar.maxSignatureFileSize=9000000 MyAppMain

You may also be able to specify jdk.jar.maxSignatureFileSize via the JAVA_TOOL_OPTIONS environment variable:

JAVA_TOOL_OPTIONS=-Djdk.jar.maxSignatureFileSize=9000000

Setting / Reading jdk.jar.maxSignatureFileSize at Runtime

You can set jdk.jar.maxSignatureFileSize at runtime with the following Java code:

System.setProperty("jdk.jar.maxSignatureFileSize", "9000000");

WARNING: Depending on the property and JVM version using setProperty may or may not work if the JDK Java class that uses this variable has already been loaded. The value of the jdk.jar.maxSignatureFileSize system property may be cached within an internal private static variable of the implementing class.

To read the value of jdk.jar.maxSignatureFileSize at runtime, you can use this Java code:

String propertyValue = System.getProperty("jdk.jar.maxSignatureFileSize");
if (propertyValue != null) {
    System.out.println("jdk.jar.maxSignatureFileSize = " + propertyValue);
} else {
    System.out.println("jdk.jar.maxSignatureFileSize was null");
}