title: How to assign a value from application.properties to a static variable?
body: <p>I am using Spring MVC. I have a <code>UserService</code> class annotated with <code>@Service</code> that has a lot of static variables. I would like to instantiate them with values from the application.properties file.</p>
  
  <p>For example in application.properties I have: <code>SVN_URL = http://some.url/repositories</code></p>
  
  <p>Then in the class there is: <code>@Value("${SVN_URL}") private static String SVN_URL</code></p>
  
  <p>I get the <code>Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError</code></p>
  
  <p>I have also tried <code>@Autowired private static Environment env;</code></p>
  
  <p>And then: <code>private static String SVN_URL=env.getProperty("SVN_URL");</code></p>
  
  <p>It gives the same error.</p>