title: spark-shell load scala config using typesafe config
body: <p>I am trying to load <code>application.conf</code> in spark-shell using typesafe-config.</p>
  
  <p>Following is the code and spark-shell command:</p>
  
  <p><strong>scala code:</strong></p>
  
  <pre><code>import com.typesafe.config.{Config, ConfigFactory}
  
  val config: Config = ConfigFactory.load("application.conf")
  val env = config.getString("key.key1")
  </code></pre>
  
  <p><strong>spark-shell commands</strong>:</p>
  
  <ul>
  <li><code>spark-shell --jars confing-1.3.4.jar  --files application.conf --driver-java-options -Dconfig.file=application.conf</code> (attempt 1)</li>
  <li><code>spark-shell --jars confing-1.3.4.jar (attempt 2)</code></li>
  </ul>
  
  <p><strong>application.conf:</strong></p>
  
  <pre><code>key {
  
   key1 = "value1"
  
  }
  </code></pre>
  
  <p><strong>error:</strong></p>
  
  <pre><code>com.typesafe.config.ConfigException$Missing: system properties: No configuration setting found for key 'key'
  </code></pre>