title: IntelliJ switching between JBOSS_HOME
body: <p>Using intelliJ 15 Ultimate on MAC Yosemite.
  I have two Jboss installation, jboss-eap-6.4 and wildfly-10.1.0.Final.
  Depending on what project I am working on I need the "Run/Debug Configuration" to choose the correct JBOSS_HOME. </p>
  
  <p>My bash_profile : </p>
  
  <pre><code>export JBOSS_HOME=/usr/local/jboss-eap-6.4
  </code></pre>
  
  <p>I also added convenience way to change in the terminal</p>
  
  <pre><code>alias setEAP='JBOSS_HOME=/usr/local/jboss-eap-6.4'
  alias setWILDFLY='export JBOSS_HOME=/usr/local/wildfly-10.1.0.Final'
  </code></pre>
  
  <p>In Intellij I have : 
  <a href="https://i.stack.imgur.com/M5il5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M5il5.png" alt="enter image description here"></a>
  Every time I run one of the Run/Debug it chooses the JBOSS_HOME set in bash_profile. </p>
  
  <pre><code>/usr/local/wildfly-10.1.0.Final/bin/standalone.sh
  
  WARNING:  JBOSS_HOME may be pointing to a different installation - unpredictable results may occur.
  
  JBOSS_HOME: /usr/local/jboss-eap-6.4
  </code></pre>
  
  <p>I tried to create an External Tool where I export JBOSS_HOME, but this does not work. Anyway I can switch between JBOSS installation ? This could also be applicable to JAVA_HOME</p>
  
  <p><a href="https://i.stack.imgur.com/fzdO4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fzdO4.png" alt="enter image description here"></a></p>