title: IBM Java get defaults (to mitigate CVE-2021-44228 AKA Log4Shell vulnerability)
body: <p>How can I dump on Java (IBM Java) the default values to check the default of the following?</p>
  <pre><code>&quot;com.sun.jndi.rmi.object.trustURLCodebase&quot;
  &quot;com.sun.jndi.cosnaming.object.trustURLCodebase&quot;
  </code></pre>
  <p>Something like this, but for the above parameters:</p>
  <pre class="lang-none prettyprint-override"><code>java -XX:+PrintFlagsFinal -version
  </code></pre>
  <p>This is for a <a href="https://en.wikipedia.org/wiki/Log4Shell" rel="nofollow noreferrer">CVE-2021-44228</a> mitigation review.</p>
  <p>Ideally this can be checked on cmd and not need to run test code.</p>
  <p>Here is my attempt of test code which doesn't show (display Null):</p>
  <pre class="lang-java prettyprint-override"><code>import java.util.Properties;
  
  class TiloDisplay
  {
      public static void main(String[] args)
      {
          Properties prop = System.getProperties();
          printProperties(prop);
      }
  
      public static void printProperties(Properties prop) {
          prop.stringPropertyNames().stream()
                  .map(key -&gt; key + &quot;: &quot; + prop.getProperty(key))
                  .forEach(System.out::println);
          System.out.println(&quot;CVE check part ========================================== &quot; );
          System.out.println(&quot;CVE check for:: com.sun.jndi.ldap.object.trustURLCodebase: &quot; + prop.getProperty(&quot;com.sun.jndi.ldap.object.trustURLCodebase&quot;));
          System.out.println(&quot;CVE check for:: com.sun.jndi.rmi.object.trustURLCodebase: &quot; + prop.getProperty(&quot;com.sun.jndi.rmi.object.trustURLCodebase&quot;));
          System.out.println(&quot;CVE check for:: com.sun.jndi.cosnaming.object.trustURLCodebase: &quot; + prop.getProperty(&quot;com.sun.jndi.cosnaming.object.trustURLCodebase&quot;));
          System.out.println(&quot;Cross Check: &quot; + prop.getProperty(&quot;java.version&quot;));
      }
  }
  </code></pre>
  <p>Compile and run:</p>
  <pre class="lang-none prettyprint-override"><code>javac DisplayApp.java -source 1.8 -target 1.8
  java TiloDisplay
  </code></pre>