title: How to access environment variables from .properties using java?
body: <p>I'm using java to implement AWS SQS. I want to have a .properties file in which I want to store and access an environment variable for an AWS SQS Access and Secret Key. At the moment, my .properties file is:</p>
  
  <pre><code>dev.access.key={$AWS_ACCESS_KEY}
  dev.secret.access.key={$AWS_SECRET_ACCESS_KEY}
  </code></pre>
  
  <p>My code to access these variables is:</p>
  
  <pre><code>String awsAccessKey = properties.getProperty("dev.access.key");
  String awsSecretAccessKey = properties.getProperty("dev.secret.access.key");
  </code></pre>
  
  <p>I have already instantiated properties and it's well defined. I'm able to get other properties but unable to access the environment variables Access and Secret Key, which I require. That is currently awsAccessKey, awsSecretAccessKey are defined as null. Is there perhaps something wrong with my syntax of how I'm accessing those environment variables?</p>