title: Setting the JAVA_HOME and PATH on MacOS
body: <p>I want to execute build.xml file using ant. But I am having trouble with recognizing the path for ant and Java. I tried changing the location to the correct location in bashrc as well as tried changing it for current command window using following commands:</p>
  
  <pre><code>export path=/usr/local/apache-ant/bin:"$PATH"
  echo 'export path=/usr/local/apache-ant/bin:"$PATH"' &gt;&gt; ~/.profile
  
  export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin:"$PATH"
  </code></pre>
  
  <p>similarly echo to profile for JAVA_HOME
  But when I check the paths for these they are not changed. Am I missing something? </p>
  
  <pre><code>echo $path
  /usr/local/apache-ant/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
  
  
  echo $JAVA_HOME
  /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
  </code></pre>
  
  <p>Thanks for your help</p>