(All ant build generations are performed with UI form compilation = OFF. Multiple or single ant build does not matter.)
Get a project with JDK = some IDEA jdk (tested one from build 6593). Main menu | Build | Generate ant build. Set option Use project SDK definition = ON. Generate ant build. Run from IDEA (from Ant build window). Build fails. Starting message:
C:\uf\Alexander.Chernikov\work\iprojs-6.5\garb11-ant\module_garb11-ant.xml:42: Error running C:\JetBrains\6.5\6593\jre\jre\bin\javac compiler
Actually, pointed installation directory does not contain javac.
Build does not fail if project JDK is not IDEA or not used in generation.