# Kotlin, Groovy and Java Compilation

**URL:** <https://discuss.gradle.org/t/kotlin-groovy-and-java-compilation/14903>\
**Category:** Help/Discuss\
**Created:** [March 3, 2016, 3:27am UTC](https://discuss.gradle.org/t/kotlin-groovy-and-java-compilation/14903 "2016-03-03T03:27:36Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![st\_oehme](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/st_oehme/32/5249_2.png) [@st\_oehme](https://discuss.gradle.org/u/st_oehme)\
**Post date:** [March 28, 2016, 3:31pm UTC](https://discuss.gradle.org/t/kotlin-groovy-and-java-compilation/14903/9 "2016-03-28T15:31:18Z")

</div>

The problem here is simple: The Kotlin plugin authors decided that Kotlin should be compiled before Java. The Groovy plugin on the other hand makes the opposite assumption.

You can try overriding the Kotlin plugin’s behavior by doing:

```gradle
compileJava.dependsOn = compileJava.taskDependencies.values - compileKotlin
compileKotlin.dependsOn(compileGroovy)

```

---

_[View the full topic](https://discuss.gradle.org/t/kotlin-groovy-and-java-compilation/14903)._
