title: how to read environment variable in distribution of electron app
body: <p>electronic app has the following package.json:</p>
  <p><strong>package.json</strong></p>
  <pre class="lang-json prettyprint-override"><code>&quot;scripts&quot;: {
      &quot;start&quot;: &quot;electron .&quot;,
      &quot;pack&quot;: &quot;electron-builder --dir&quot;,
      &quot;dist&quot;: &quot;electron-builder&quot;
    }
  </code></pre>
  <p>I can read environment variables by running the electron app with <code>npm start</code>.</p>
  <pre class="lang-js prettyprint-override"><code>process.env.JAVA_HOME
  </code></pre>
  <p>the result exists.</p>
  <p>However, if I create a distribution of the electronic app with the <code>npm run dist</code> command and then run the distribution app, I cannot read the environment variable.</p>
  <p>the result is <code>undefined</code></p>
  <p>How can I read environment variables in distribution of the electronic app?</p>
  <p>I'm working on macOS Monterey</p>