LoginSignup
0
0

More than 5 years have passed since last update.

Androidアプリ:jackコンパイラでjava8を使う

Last updated at Posted at 2016-07-20

深くは調査してないけど、jackOptionsとcompileSdkVersionを24して、minSdkVersionを15とかにすれば、iceでもjava8のコードが動作するね。

でもlombokのコードがビルドできなかったので、ちょっとつらいな。何か方法があるのかしら。

java8のパスを設定

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

build.gradleの設定

android {
    compileSdkVersion 24
    buildToolsVersion '24.0.1'

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        jackOptions {
            enabled true
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    ...
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0