# Gradle 2.14 deprecating java 6 as runtime

**URL:** <https://discuss.gradle.org/t/gradle-2-14-deprecating-java-6-as-runtime/17440>\
**Category:** Help/Discuss\
**Created:** [May 4, 2016, 12:07pm UTC](https://discuss.gradle.org/t/gradle-2-14-deprecating-java-6-as-runtime/17440 "2016-05-04T12:07:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Svojanovsky](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@Daniel\_Svojanovsky](https://discuss.gradle.org/u/Daniel_Svojanovsky)\
**Post date:** [May 4, 2016, 12:07pm UTC](https://discuss.gradle.org/t/gradle-2-14-deprecating-java-6-as-runtime/17440/1 "2016-05-04T12:07:40Z")

</div>

Hi,

> Support for running Gradle on Java 6  
> Running Gradle using Java 6 is now deprecated, and support will be removed in Gradle 3.0.
> 
> It will continue to be possible to build JVM based projects for Java 6, by running Gradle using Java 7 and configuring Gradle to use Java 6 to compile, test and run your code.

AFAIK there is no way how to specify compiler for scala and groovy. How this is going to work?

Thanks.

---

<div class="post-metadata">

**Author:** ![Stefan\_Wolf](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/stefan_wolf/32/5519_2.png) [@Stefan\_Wolf](https://discuss.gradle.org/u/Stefan_Wolf)\
**Post date:** [May 9, 2016, 10:57am UTC](https://discuss.gradle.org/t/gradle-2-14-deprecating-java-6-as-runtime/17440/2 "2016-05-09T10:57:55Z")

</div>

Hi.

The compiler for Groovy and Scala is inferred from the Groovy/Scala library on the classpath but can also bet set explicitely (see [https://docs.gradle.org/current/userguide/scala\_plugin.html#sec:configure\_scala\_classpath](https://docs.gradle.org/current/userguide/scala_plugin.html#sec:configure_scala_classpath) and [https://docs.gradle.org/current/userguide/groovy\_plugin.html](https://docs.gradle.org/current/userguide/groovy_plugin.html) -\> DependencyManagement).

Additionally, the sourceCompatibility and targetCompatibility need to be set to the correct version for the Groovy and Scala Compiler to generate Class files of the correct version.

---

<div class="post-metadata">

**Author:** ![Daniel\_Svojanovsky](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@Daniel\_Svojanovsky](https://discuss.gradle.org/u/Daniel_Svojanovsky)\
**Post date:** [May 9, 2016, 2:11pm UTC](https://discuss.gradle.org/t/gradle-2-14-deprecating-java-6-as-runtime/17440/3 "2016-05-09T14:11:44Z")

</div>

I quite don’t understand how groovy library affects the java runtime? Setting target compatibility is not the same thing as using specific compiler/jdk. At least not for me.

The thing is that for java I can set this:

`
tasks.withType(AbstractCompile) {
   options.forkOptions.executable = /my/path/to/java1.8/bin/javac
   options.bootClasspath = fileTree("/my/path/to/java1.6/jre/lib") { include '*.jar' }.asPath()
}
`

Unfortunately, I can do whatever I want but the JAVA\_HOME will be used to actually run the compilers and I really don’t see any way to specify how the bootclasspath should look like (against what libraries I want to compile my code).

---

<div class="post-metadata">

**Author:** ![Stefan\_Wolf](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/stefan_wolf/32/5519_2.png) [@Stefan\_Wolf](https://discuss.gradle.org/u/Stefan_Wolf)\
**Post date:** [May 10, 2016, 4:44pm UTC](https://discuss.gradle.org/t/gradle-2-14-deprecating-java-6-as-runtime/17440/4 "2016-05-10T16:44:21Z")

</div>

You are right: You cannot set the bootclasspath for the Scala and Groovy compiler via Gradle. This is only an issue if you depend in the Groovy/Scala code on an incompatibility between the JDKs.  
At some point in the future the new Java Software Model will support toolchains different from the current JDK for Scala/Groovy.

---

<div class="post-metadata">

**Author:** ![Daniel\_Svojanovsky](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@Daniel\_Svojanovsky](https://discuss.gradle.org/u/Daniel_Svojanovsky)\
**Post date:** [May 11, 2016, 8:13am UTC](https://discuss.gradle.org/t/gradle-2-14-deprecating-java-6-as-runtime/17440/5 "2016-05-11T08:13:54Z")

</div>

Thanks for confirmation about the software model, I kindof hoped that it will be possible with some “toolchain” tweaks.
