title: how to set timezone for jvm through command line
body: <p>My local machine's timezone is <strong>HST</strong>. But JVM giving me CUT/UTC timezone. I tried using <strong>java -Duser.timezone=America/Adak Example</strong>, but it sets HST only for Example.class . How/where  can  <strong>I See/Change the JVM's timezone?</strong></p>
  
  <p>The ZONE value in <strong>/etc/sysconfig/clock</strong> is pointing to HST timezone only.</p>
  
  <pre><code>class Example {
  public static void main(String[] args) {
      System.out.println(java.util.TimeZone.getDefault());
  } 
  }
  </code></pre>
  
  <p>The Above code is giving me <strong>UTC timezone</strong>. </p>
  
  <p>I am using <strong>CentOS vagrant box</strong> and <strong>java 8</strong>.</p>
  
  <p>I can Set the Timezone by using <strong>java -Duser.timezone=America/Adak</strong></p>
  
  <p>by using above statement <strong>we are externally setting the timezone</strong>. But we are not taking <strong>the Default/machine's timezone</strong>. </p>
  
  <p>I am asking how can we get/see/change the <strong>system's timezone</strong> using java.</p>