title: Reading values from application.properties Spring Boot
body: <p>My Spring boot app has this application structure:</p>
  
  <ul>
  <li>src
  
  <ul>
  <li>main
  
  <ul>
  <li>java</li>
  <li>resources
  
  <ul>
  <li>application.properties</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>This is my application.properties file:</p>
  
  <pre><code>logging.level.org.springframework=TRACE
  logging.level.org.hibernate=ERROR
  spring.resources.chain.strategy.content.enabled=true
  spring.resources.chain.strategy.content.paths=/**
  #spring.resources.chain.cache=false
  #spring.resources.chain.html-application-cache=false
  #spring.headers.cache=false
  language=java
  </code></pre>
  
  <p>I have a class which requires the use of that language=java property. This is how I am trying to use it:</p>
  
  <pre><code>public class EntityManager {
  
      @Value("${language}")
      private static String newLang;
  
      public EntityManager(){
          System.out.println("langauge is: " + newLang);
      }
  }
  </code></pre>
  
  <p>That printed <strong>value is always "null"</strong> for some reason! I have also tried putting this on top of the class declaration:</p>
  
  <pre><code>@PropertySource(value = "classpath:application.properties")
  </code></pre>