Why not java?

I don’t quite understand why everyone not implementing build systems for java in java but in other JVM scripting languages, xml and anything else than java?

Is this impossible? Is classloading different?

Gradle is, to a large extent, implemented in Java. Only build scripts are written in Groovy. The reason is that Groovy is a much better fit for implementing a domain-specific language than Java. A build language built on top of Java would be either excessively verbose or far less powerful than what we have today.