title: apache ant build.xml:577: Unable to find a javac compiler
body: <p>Any idea?
  There are ton of posts out of there but I didn't find any solution for mac, yet.
  I've downloaded the ant source code and trying to run the build but no success here. I found some posts saying about set the JAVA_HOME with JDK but this is something I did...
  no thought here so any input would be appreciated</p>
  
  <pre><code>myMac:apache-ant-1.9.7 mauri$ pwd
  /Users/mauri/Downloads/apache-ant-1.9.7
  myMac:apache-ant-1.9.7 mauri$ l
  total 1032
  drwxr-xr-x@  8 mauri  wheel   272B  9 Abr  2016 src
  -rw-r--r--@  1 mauri  wheel   1,9K  9 Abr  2016 patch.xml
  -rw-r--r--@  1 mauri  wheel   4,3K  9 Abr  2016 get-m2.xml
  -rw-r--r--@  1 mauri  wheel    11K  9 Abr  2016 fetch.xml
  -rw-r--r--@  1 mauri  wheel    29K  9 Abr  2016 contributors.xml
  -rw-r--r--@  1 mauri  wheel    75K  9 Abr  2016 build.xml
  -rwxr-xr-x@  1 mauri  wheel   1,7K  9 Abr  2016 build.sh
  -rw-r--r--@  1 mauri  wheel   1,6K  9 Abr  2016 build.bat
  -rwxr-xr-x@  1 mauri  wheel   4,4K  9 Abr  2016 bootstrap.sh
  -rw-r--r--@  1 mauri  wheel   4,4K  9 Abr  2016 bootstrap.bat
  -rw-r--r--@  1 mauri  wheel   228K  9 Abr  2016 WHATSNEW
  -rw-r--r--@  1 mauri  wheel   4,0K  9 Abr  2016 README
  -rw-r--r--@  1 mauri  wheel   305B  9 Abr  2016 NOTICE
  -rw-r--r--@  1 mauri  wheel    15K  9 Abr  2016 LICENSE
  -rw-r--r--@  1 mauri  wheel    90K  9 Abr  2016 KEYS
  -rw-r--r--@  1 mauri  wheel   126B  9 Abr  2016 INSTALL
  -rw-r--r--@  1 mauri  wheel   5,9K  9 Abr  2016 CONTRIBUTORS
  drwxr-xr-x@ 49 mauri  wheel   1,6K 15 Dez 23:43 manual
  drwxr-xr-x@  5 mauri  wheel   170B 15 Dez 23:43 lib
  myMac:apache-ant-1.9.7 mauri$ sh build.sh
  ... Bootstrapping Ant Distribution
  ... Compiling Ant Classes
  Note: Some input files use or override a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  Note: Some input files use unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  ... Copying Required Files
  ... Building Ant Distribution
  Buildfile: /Users/mauri/Downloads/apache-ant-1.9.7/build.xml
  
  bootstrap:
  
  prepare:
  
  check_for_optional_packages:
  
  build:
  Created dir: /Users/mauri/Downloads/apache-ant-1.9.7/build/lib
  
  BUILD FAILED
  /Users/mauri/Downloads/apache-ant-1.9.7/build.xml:1078: The following error occurred while executing this line:
  /Users/mauri/Downloads/apache-ant-1.9.7/build.xml:577: Unable to find a javac compiler;
  com.sun.tools.javac.Main is not on the classpath.
  Perhaps JAVA_HOME does not point to the JDK.
  It is currently set to "/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/jre"
  
  Total time: 0 seconds
  ... Failed Building Ant Distribution !
  Bootstrap FAILED
  myMac:apache-ant-1.9.7 mauri$ java -version
  java version "1.8.0_111"
  Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
  Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
  myMac:apache-ant-1.9.7 mauri$ javac -version
  javac 1.8.0_111
  myMac:apache-ant-1.9.7 mauri$ echo $JAVA_HOME
  /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
  myMac:apache-ant-1.9.7 mauri$ sw_vers
  ProductName:    Mac OS X
  ProductVersion: 10.11.6
  BuildVersion:   15G1004
  myMac:apache-ant-1.9.7 mauri$ which javac
  /usr/bin/javac
  myMac:apache-ant-1.9.7 mauri$ ls -l /usr/bin/javac
  lrwxr-xr-x  1 root  wheel  75 16 Abr  2016 /usr/bin/javac -&gt; /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
  myMac:apache-ant-1.9.7 mauri$ file /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac
  /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac: Mach-O universal binary with 2 architectures
  /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac (for architecture i386):    Mach-O executable i386
  /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/javac (for architecture x86_64):  Mach-O 64-bit executable x86_64
  </code></pre>
  
  <p>I've tried to change the JAVA_HOME pointing to the JDK but ant is trying to use java in bin but doesn't work because in MAC is within the path Contents/Home</p>
  
  <pre><code>myMac:apache-ant-1.9.7 mauri$ export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk
  myMac:apache-ant-1.9.7 mauri$ sh build.sh 
  Error: JAVA_HOME is not defined correctly.
    We cannot execute /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/bin/java
  Bootstrap FAILED
  myMac:apache-ant-1.9.7 mauri$ ls /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/bin/java
  ls: /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/bin/java: No such file or directory
  </code></pre>