As you can see, there is no need for even typing runnable as the Java compiler will automatically work out what is needed for these lambda functions and it will pass as a runnable to the Thread constructor.
To use this in ForgeGradle we would initially think that just setting:
Which, in any case outside of ForgeGradle is enough to say to Gradle anyway that we are targeting Java SE 8 byte code. Whereas in the case of FML, it has inner dependencies of ASM 4.0.1 and the earliest release to have Java 8 support in ASM is version 5.0.0.
From here, there is an older thing that we had to do in older versions for FML to allow for newer java classes to be ran, though nowadays it is no longer needed for forge due to a satisfactory ASM version.
So, do we just add in the dependencies to look at
mavenCentral() and then apply our own dependency of
compile 'org.ow2.asm:asm-debug-all:5.0.3'? Well, that is part of the solution, because another part of this hack, as I am calling it, also has a prioritization to the factor of compatibility, since when we end up running the
gradle build and grabbing the generated jar files, it will not load in Minecraft, why? Well, to put it simply, ASM 4.0.1 as FML uses, does not understand it!
After a lot of research I have found a nifty tool called Retrolambda and a gradle plugin for it, Gradle-Retrolambda after a bit of tinkering around with the plugin I have determined how to properly use this plugin when using ForgeGradle.
So, to get this working, with ForgeGradle, as explained in the Gradle Retrolambda github page, we need to add
'me.tatarka:gradle-retrolambda:2.2.3' to the buildscript classpath and then, after the
apply plugin: 'forge' we need to add yet another plugin to be applied,
Notice: This is not needed if you have JAVA_HOME pointing towards a valid JDK8 install.
There are some more. Advanced configuration that you can do when applying the plugin which is documented at the GitHub page and it also assumes the JAVA6_HOME, JAVA7_HOME and JAVA8_HOME environment variables exist (you only need 1 of 6 OR 7) pointing towards a valid JDK install.