title: MacOS and Environment variables
body: <p>I have set my environment variables in my <code>.bash_profile</code> file. I have <code>macOS 10.12.6</code> </p>
  
  <p>It's looks like:</p>
  
  <pre><code>#MYENV environemnt
  export MY_ENV=/Users/user_name/directory
  </code></pre>
  
  <p>I create a simple java code, that try to read all environment variables:</p>
  
  <pre><code>  public static void main(String[] args) {
              Map&lt;String, String&gt; env = System.getenv();
  
              for (String envName : env.keySet()) {
                  System.out.println("name: " + envName);
  
              }
      }
  </code></pre>
  
  <p>If I run my code it prints only these varriables:</p>
  
  <pre><code>run:
  name: PATH
  name: J2D_PIXMAPS
  name: SHELL
  name: JAVA_MAIN_CLASS_3122
  name: USER
  name: TMPDIR
  name: JAVA_MAIN_CLASS_2967
  name: SSH_AUTH_SOCK
  name: XPC_FLAGS
  name: LD_LIBRARY_PATH
  name: __CF_USER_TEXT_ENCODING
  name: Apple_PubSub_Socket_Render
  name: LOGNAME
  name: LC_CTYPE
  name: XPC_SERVICE_NAME
  name: PWD
  name: SHLVL
  name: HOME
  name: _
  BUILD SUCCESSFUL (total time: 0 seconds)
  </code></pre>
  
  <p>If I run <code>printenv</code> command from my terminal, i can see my environment variable.</p>
  
  <p>So my problem is, why cannot my java application see all environment varriables?
  Thank you!</p>