配置
retrolambda github:https://github.com/evant/gradle-retrolambda
retrolambda配置:http://juude.net/lambdajava/
- jdk8
- classpath:使用retrolambda来编译Java代码
- 在Project的buildscript->dependencies中增加classpath
- classpath 'me.tatarka:gradle-retrolambda:3.3.0-beta4'
- plugin
- 在app module的build.gradle中增加plugin
- apply plugin: 'me.tatarka.retrolambda'
- compileOptions:让IDE使用用JAVA8语法解析
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }
jdk
首先下载jdk配置完成
JDK8:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
文档:http://docs.oracle.com/javase/8/
API:http://docs.oracle.com/javase/8/docs/api/
gradle
查看grade版本:http://jingyan.baidu.com/article/cbcede0710f49802f50b4d78.html
grade版本:http://services.gradle.org/distributions
grade参考资料:http://www.cnblogs.com/youxilua/archive/2013/05/20/3087935.html
Android Plugin for Gradle:http://developer.android.com/tools/revisions/gradle-plugin.html