title: How to access properties @value using spring boot
body: <p>I would to read application.properties using <code>@Value</code>.</p>
  <p>app.properties</p>
  <pre><code>JDBC_DRIVER =com.mysql.cj.jdbc.Driver
  DB_URL =jdbc:mysql://127.0.0.1:3306/vetobooks?useUnicode=true&amp;useJDBCCompliantTimezoneShift=true&amp;useLegacyDatetimeCode=false&amp;serverTimezone=UTC
  USER =root
  PASS =a
  </code></pre>
  <p>main</p>
  <pre><code>package com.example.java_spring_java_example;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.ConfigurableApplicationContext;
  
  
  @SpringBootApplication
      public class main {
              
          public static void main(String[] args) {
          
              
              ConfigurableApplicationContext context = SpringApplication.run(main.class, args);
              context.getBean(JDBCMysql.class);
              
          }
  
      }
  </code></pre>
  <p>JDBCMysql</p>
  <pre><code>package com.example.java_spring_java_example;
  import org.springframework.beans.factory.annotation.Value;
  import org.springframework.stereotype.Component;
  @Component
  public class JDBCMysql {
        @Value(&quot;${JDBC_DRIVER}&quot;)
          public String JDBC_DRIVE;
         
          @Value(&quot;${USER}&quot;)
          public String USER;
  
          @Value(&quot;${PASS}&quot;)
          public String PASS;
  
          @Value(&quot;${DB_URL}&quot;)
          public String DB_URL;
      public void loadValue() {
        System.out.println(DB_URL+&quot;-&quot;+ USER+&quot;-&quot;+ PASS+&quot;...&quot;);
      }
         }
  </code></pre>
  <p>I get null-null-null as a result. How can I get the real values?</p>