# Cannot build GroovyFX under Java 8 due to org.gradle.api.GradleException: Could not load class

**URL:** <https://discuss.gradle.org/t/cannot-build-groovyfx-under-java-8-due-to-org-gradle-api-gradleexception-could-not-load-class/4803>\
**Category:** Old Forum Archive\
**Created:** [August 29, 2013, 12:12pm UTC](https://discuss.gradle.org/t/cannot-build-groovyfx-under-java-8-due-to-org-gradle-api-gradleexception-could-not-load-class/4803 "2013-08-29T12:12:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tim\_yates](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tim_yates/32/7849_2.png) [@tim\_yates](https://discuss.gradle.org/u/tim_yates)\
**Post date:** [August 29, 2013, 12:12pm UTC](https://discuss.gradle.org/t/cannot-build-groovyfx-under-java-8-due-to-org-gradle-api-gradleexception-could-not-load-class/4803/1 "2013-08-29T12:12:00Z")

</div>

I’ve posted the exact steps to reproduce this issue here:

[https://gist.github.com/timyates/e8bced71258034b394c4](https://gist.github.com/timyates/e8bced71258034b394c4)

Basically, I’m not even 100% sure this is a Gradle issue, but as it’s a Gradle exception (and looks like it’s the bundled asm lib failing to load a Java 8 class), I thought this was a good place to start

Hope it makes sense

Cheers,

Tim

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [September 2, 2013, 8:01am UTC](https://discuss.gradle.org/t/cannot-build-groovyfx-under-java-8-due-to-org-gradle-api-gradleexception-could-not-load-class/4803/2 "2013-09-02T08:01:00Z")

</div>

Java 8 requires ASM 5, which is currently in alpha. You may want to run with Java 7 and only compile against 8. Right now, the only way to achieve this is to set ‘compileJava.options.forkOptions.executable’.

---

<div class="post-metadata">

**Author:** ![tim\_yates](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/tim_yates/32/7849_2.png) [@tim\_yates](https://discuss.gradle.org/u/tim_yates)\
**Post date:** [September 2, 2013, 10:54am UTC](https://discuss.gradle.org/t/cannot-build-groovyfx-under-java-8-due-to-org-gradle-api-gradleexception-could-not-load-class/4803/3 "2013-09-02T10:54:00Z")

</div>

Cool, thanks Peter 🙂

Just tried, and you can build the jdk8 branch of groovyfx with java 7, and then it works under java 8 🙂

Thanks again!
