title: Spring-Boot > Setting application.properties using JNDI
body: <p>According to this <a href="https://github.com/spring-projects/spring-boot/issues/976" rel="nofollow noreferrer">github issue</a>, I can specify the location of an application.properties file. e.g.</p>
  
  <p><strong><em>JNDI Environment Resource:</em></strong></p>
  
  <pre><code>java:comp/env/spring.config.location = /some/path/application.properties
  </code></pre>
  
  <p>What I'd like to know is: </p>
  
  <p><strong>Can I use a JNDI binding to directly configure an individual application.properties property value in my Spring Boot application?</strong></p>
  
  <p>I've tried the following JNDI vars (to no avail):</p>
  
  <p><strong><em>JNDI Environment Resource:</em></strong></p>
  
  <pre><code>java:comp/env/my.env.myCustomStringField = foobar
  java:comp/env/my.env.my-custom-string-field = foobar
  </code></pre>
  
  <p><a href="https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html" rel="nofollow noreferrer">Spring Reference:</a></p>
  
  <blockquote>
    <p>If you are running in a container then JNDI properties (in <code>java:comp/env</code>) or servlet context initialization parameters can be used instead of, or as well as, environment variables or system properties.</p>
  </blockquote>
  
  <p>I'm currently using <a href="https://stackoverflow.com/questions/36664417/spring-boot-jndi-value-lookup/37020384#37020384">the following workaround</a>.</p>