Getting "Error starting modern compiler" when including an Ant build

I’m trying to move my companies huge application build (~70,000 files) from a hodge podge of ant scripts held together with duct tape and chewing gum to a cohesive gradle build. But in the process we’ll have several months (or possibly years) of needing to run our ~350 Ant build scripts during the transition. I have several of the scripts working quite well (as far as I can tell), but I’m running into one stubborn script that’s erroring out and searching the inter-webs hasn’t pointed me to a solution, so I’m hoping you good folks can help me over this hump. The gradle build that’s failing is:

ant.importBuild 'build.xml'
task build (dependsOn: dist)

Running that script produces:

:milan:components:roles:generate FAILED
  FAILURE: Build failed with an exception.
  * What went wrong:
Execution failed for task ':milan:components:roles:generate'.
> Error starting modern compiler
  * Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
  Total time: 14.659 secs

The Ant task that’s failing is:

<taskdef name="xjc" classname="">
        <fileset dir="${libdir}/jaxb/2.2.6/lib" includes="*.jar" />
  <target name="generate">
    <mkdir dir="src/generated"/>
    <xjc schema="src/conf/roleModuleMetaData.xsd" destdir="src/generated" package="com.pearson.powerschool.roles.jaxb" >
        <produces dir="src/generated/com/pearson/powerschool/roles/jaxb" includes="**/*.java"/>
    <mkdir dir="build/classes"/>
    <javac destdir="build/classes" srcdir="src/generated" debug="true" classpath="" includeantruntime="false"/>

Anyone run into this problem before? Or have any idea how to solve it? Thanks.


Looks very arcane. I’ve never seen an error like it.

Run with ‘-s’ to see where it’s coming from. I’d say the XJC task is a likely candidate.

I’m not sure what caused it, but it seemed to be machine specific. When I tried it on another machine I found out there was also a circular reference between some of the projects. Once I resolved that conflict (by changing the ant target above) the problem went away even on the originally affected machine. So, I have no idea what was causing it or why it went away, but it’s currently not a problem.