title: How to resolve environment variables in runtime in java
body: <p>My java application needs to resolve environment variables in file paths at runtime , file paths will be specified in properties file as below
  in case of windows it will be %JAVA_HOME%\certs\myselffign.cer
  in case of unix it will be $JAVA_HOME\certs\myselffign.cer</p>
  
  <p>My java apps needs to resolve those file path to absolute paths and load the certificates into truststore.</p>
  
  <p>Is there any way to this.
  As of now i am checking os.name , and if os.name is windows then pattern matching for %% and using system.getenv , in case of non windows looking for $.</p>
  
  <p>I am hoping there is a better way to do this</p>