title: How Do I check PATH and CLASSPATH environment variables from java?
body: <p>I am making a java program to read an audio.wav file with JMF.I have to set path from cmd every time my computer restarts like this</p>
  
  <pre><code>    set CLASSPATH=%WINDIR%\java\classes\jmf.jar;%WINDIR%\java\classes\sound.jar;.;%CLASSPATH%
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    set PATH=%WINDIR%\System32;%PATH%  
  </code></pre>
  
  <p>otherwise the program will compile but not run
  I wanted to do it through </p>
  
  <pre><code>    System.setProperty(key,value);
  </code></pre>
  
  <p>I don't know cmd commands,so in order to check the value of CLASSPATH and PATH after setting it through cmd I tried</p>
  
  <pre><code>    public void checkProperty (){
      System.setProperty("temporaryvar","blahblah");
      System.out.println(""+System.getProperty("temporaryvar"));//prints out blahblah
      System.out.println(""+System.getProperty("CLASSPATH"));//prints out null
      System.out.println(""+System.getProperty("PATH"));//prints out null
      }
  </code></pre>
  
  <p>I get it printed out as</p>
  
  <pre><code>    blahblah
      null
      null
  </code></pre>
  
  <p>What's the reason I am getting the value of variable I set from the program back but not the one I set from the cmd?Is this the right approach?I need to set both these paths from java..plz help</p>