0

How so I get the default value of system property in java like ntlm.debug or jdk.tls.stapling. ignoreExtensions On using system.getProperty(Property name) gives null. I am running with jdk version 11.0.7 Is there any other way to get default values of the properties?

2
  • 1
    Please provide a minimal reproducible example. Also how are you running your program? From the command line or in an IDE (like Eclipse, Netbeans, IntelliJ etc)
    – Lino
    Commented Jun 19, 2020 at 5:45
  • import java.util.Properties; public class ListSystemProperties { public static void main(String[] args) { System.out.println(System.getProperty("jdk.tls.stapling.ignoreExtensions")); } } This is basic code I am using and running from command line
    – nzare
    Commented Jun 19, 2020 at 5:54

1 Answer 1

2
System.getProperties() will give a map of all default properties of the system.
like
sun.management.compiler : HotSpot 64-Bit Tiered Compilers
sun.jnu.encoding : UTF-8
java.runtime.version : 14+36-1461
...
2
  • Thanks, so the ones not listed by this are not default and need to be specified explicitly?
    – nzare
    Commented Jun 19, 2020 at 5:51
  • Yes, System.getProperties().put("hello", "hello");
    – alokj
    Commented Jun 19, 2020 at 5:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.