title: JUnit on IntelliJ on OS X - Can't assign requested address
body: <p>When I run a JUnit test on IntelliJ on Mac - OS X - 10.11.2 (El Capitan), I run into the following error.</p>
  
  <pre><code>Can't assign requested address - 127.0.0.2:27425
  </code></pre>
  
  <p>The JUnit tests I'm running are already setup and they work fine when run on Ubuntu/RHEL/Windows. </p>
  
  <p>I guess the problem is with Mac not recognizing 127.0.0.* as localhost.</p>
  
  <p>I have tried the following in vain.</p>
  
  <ol>
  <li><p>Ran this command to alias localhost for 2 &lt;= i &lt;= 255 </p>
  
  <pre><code>sudo ifconfig lo0 -alias 127.0.0.$i up
  </code></pre></li>
  <li><p>Added the below lines to /etc/hosts</p>
  
  <pre><code>127.0.0.2    localhost
  127.0.0.3    localhost
  ...
  ...
  127.0.0.255    localhost
  </code></pre></li>
  </ol>
  
  <p>Greatly appreciate any hints/suggestions to fix/work around this issue.</p>