android studio使用JDK8
来源:互联网 发布:双头龟一只多少钱淘宝 编辑:程序博客网 时间:2024/06/06 17:31
吐嘈:麻蛋,我电脑CSDN又抽风了~~~
最近不知道在忙什么,好久没更新了,发现也没什么想分享的。还是要坚持写Blog!!
今天看了一个别人的项目,用的JDK8,不知道什么原因,一直报我错,但我电脑配置是正常的啊 - 我之前有工程用了JDK8 - 所以这里记录一下JDK8的使用方法笔记,解惑自己猜疑
如标题,我只是想使用JDK8,新建一个android studio
工程,配置如下
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0-alpha5' classpath 'me.tatarka:gradle-retrolambda:3.2.5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { jcenter() maven { url "https://jitpack.io" } }}task clean(type: Delete) { delete rootProject.buildDir}
添加classpath 'me.tatarka:gradle-retrolambda:3.2.5'
和maven { url "https://jitpack.io" }
app/build.gradle
apply plugin: 'com.android.application'apply plugin: 'me.tatarka.retrolambda'android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.xuie.jdk8_demo" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 }}dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:design:23.3.0'}
添加
apply plugin: 'me.tatarka.retrolambda'
和
compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}
- 代码测试
fab.setOnClickListener(view->Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) .setAction("Action", null).show());
上张截图,原先的写法多余部分已经为成为提示无意义
0 0
- android studio使用JDK8
- 【android】 android studio使用
- android studio使用教程
- Android Studio使用教程
- Android Studio使用教程
- Android Studio使用教程
- android studio 使用
- Android Studio使用大全
- Android Studio使用教程
- Android studio 使用问题
- Android Studio使用教程
- Android Studio使用问题
- Android Studio使用教程
- Android Studio使用
- Android Studio使用教程
- Android studio使用教程
- Android Studio使用教程
- Android Studio使用教程
- ubuntu下的编程环境配置
- iOS App 生命周期
- 鼠标悬停图片、文字css3效果
- hdu4310(贪心)
- 对我们平台进行验收工作
- android studio使用JDK8
- LLDB的简单使用
- Java基础:运行时异常和非运行时异常
- php javascript return 返回多个值 ,
- js delete
- 如何获得短名的长名?
- install-plugin-submit
- YouKu iOS笔试题一
- UI测试