# Compiling Java6 source using gradle 4.6 - executing ant task

**URL:** <https://discuss.gradle.org/t/compiling-java6-source-using-gradle-4-6-executing-ant-task/26327>\
**Category:** Help/Discuss\
**Created:** [March 20, 2018, 2:57pm UTC](https://discuss.gradle.org/t/compiling-java6-source-using-gradle-4-6-executing-ant-task/26327 "2018-03-20T14:57:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jiramares](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jiramares/32/6874_2.png) [@jiramares](https://discuss.gradle.org/u/jiramares)\
**Post date:** [March 20, 2018, 2:57pm UTC](https://discuss.gradle.org/t/compiling-java6-source-using-gradle-4-6-executing-ant-task/26327/1 "2018-03-20T14:57:40Z")

</div>

Hi,

I have problem to run aspectj weaving using gradle 4.6 (runing on jdk9) with sourceCompatibility=1.6.

I need to run ant task iajc using java6 but don’t know how to make it. I used the manual to setup compiling and running tests correctly but can’t realize how to run ant task with java6 too.

Or should I run aspectj compiler directly (without ant) and then I can specify java6 executable?

Thanks  
Jirka

---

<div class="post-metadata">

**Author:** ![jiramares](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/jiramares/32/6874_2.png) [@jiramares](https://discuss.gradle.org/u/jiramares)\
**Post date:** [March 21, 2018, 2:35pm UTC](https://discuss.gradle.org/t/compiling-java6-source-using-gradle-4-6-executing-ant-task/26327/2 "2018-03-21T14:35:56Z")

</div>

So the resolution is: I can’t run aspectj using build in ant but using the JavaExec task (which supports specifying executables) … u can see or use my aspectj plugin [https://github.com/jiramares/gradle](https://github.com/jiramares/gradle).

Jirka
