title: JAVA Spring Boot : How to access application.properties values in normal class
body: <p>I know how I can access the <code>application.properties</code> values in <code>@Service</code> classes in Java Spring boot like below</p>
  <pre><code>@Service
  public class AmazonClient {
  
      @Value(&quot;${cloud.aws.endpointUrl}&quot;)
      private String endpointUrl;
  }
  </code></pre>
  <p>But I am <strong>looking for an option to access this value directly in any class</strong> (a class without @Service annotation)</p>
  <p>e.g.</p>
  <pre><code>public class AppUtils {
        @Value(&quot;${cloud.aws.endpointUrl}&quot;)
        private String endpointUrl;
  }
  </code></pre>
  <p>But this returns <code>null</code>. Any help would be appreciated.
  I have already read <a href="https://stackoverflow.com/q/30528255/8874958">here</a> but didn't help.</p>