1 page.title=Java 8 2 page.keywords="android N", "Java 8", "Jack" 3 @jd:body 4 5 <div id="qv-wrapper"> 6 <div id="qv"> 7 <ol> 8 <li> 9 <a href="#supported-features"> Java 8 API</a> 10 </li> 11 <li> 12 <a href="#configuration">Java 8 Jack </a> 13 </li> 14 </ol> 15 </div> 16 </div> 17 18 <p>Android N Java 8 Android N Preview Java 8 19 20 21 22 23 </p> 24 25 <p>Android Studio 2.1 Android N Preview SDK Jack Gradle Android Plugin 26 27 Android N Preview SDK <a href="{@docRoot}preview/setup-sdk.html">Android N </a> 28 </p> 29 30 31 32 <p class="note"> 33 <strong>:</strong>Android N Java 8 34 Java 8 Java 7 Android N JDK 8 35 36 37 38 </p> 39 40 <h2 id="supported-features"> 41 Java 8 API 42 </h2> 43 44 <p> 45 Android Java 8 Android N Preview 46 47 48 </p> 49 50 <ul> 51 <li> 52 <a class="external-link" href="https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html"></a> 53 54 </li> 55 56 <li> 57 <a class="external-link" href="https://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html"></a>API 23 58 59 </li> 60 61 <li> 62 <a class="external-link" href="https://docs.oracle.com/javase/tutorial/java/annotations/repeating.html"></a> 63 64 </li> 65 66 <li> 67 <a class="external-link" href="https://docs.oracle.com/javase/tutorial/java/javaOO/methodreferences.html"></a>API 23 68 69 </li> 70 </ul> 71 72 <p class="note"> 73 <strong>:</strong> Android {@code build.gradle} {@code compileSdkVersion} {@code targetSdkVersion} 23 74 75 76 Java 8 <a href="#configuration">Jack </a> 77 78 </p> 79 80 <p> 81 Java 8 API 82 </p> 83 84 <ul> 85 <li> API 86 <ul> 87 <li> 88 <a class="external-link" href="https://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html"> 89 {@code java.lang.FunctionalInterface}</a> 90 </li> 91 92 <li> 93 <a class="external-link" href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Repeatable.html"> 94 {@code java.lang.annotation.Repeatable}</a> 95 </li> 96 97 <li> 98 <a class="external-link" href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Method.html#isDefault--"> 99 {@code java.lang.reflect.Method.isDefault()}</a> 100 </li> 101 102 <li> API 103 <a class="external-link" href="https://docs.oracle.com/javase/8/docs/api/java/lang/reflect/AnnotatedElement.html#getAnnotationsByType-java.lang.Class-"> 104 {@code AnnotatedElement.getAnnotationsByType(Class)}</a> 105 </li> 106 </ul> 107 </li> 108 109 <li> API 110 <ul> 111 <li> 112 <a class="external-link" href="https://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html"> 113 {@code java.util.function}</a> 114 </li> 115 116 <li> 117 <a class="external-link" href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html"> 118 {@code java.util.stream}</a> 119 </li> 120 </ul> 121 </li> 122 </ul> 123 124 <h2 id="configuration"> 125 Java 8 Jack 126 </h2> 127 128 <p> 129 Java 8 <a class="external-link" href="https://source.android.com/source/jack.html">Jack </a> 130 Android Java Android dex {@code .jack} Multidex 131 132 133 134 135 </p> 136 137 <p>Android DEX 2 </p> 138 <ul> 139 <li> javac <br> 140 <b>javac</b> ({@code .java} --> {@code .class}) --> <b>dx</b> ({@code 141 .class} --> {@code .dex}) 142 </li> 143 144 <li> Jack <br> 145 <b>Jack</b> ({@code .java} --> {@code .jack} --> {@code .dex}) 146 </li> 147 </ul> 148 149 <h3> 150 Gradle 151 </h3> 152 153 <p> 154 Java 8 Jack {@code build.gradle} 155 156 </p> 157 158 <pre> 159 android { 160 ... 161 defaultConfig { 162 ... 163 jackOptions { 164 enabled true 165 } 166 } 167 compileOptions { 168 sourceCompatibility JavaVersion.VERSION_1_8 169 targetCompatibility JavaVersion.VERSION_1_8 170 } 171 } 172 </pre> 173 174 <h3 id="known-issues"> 175 176 </h3> 177 178 <p> 179 <a href="{@docRoot}tools/building/building-studio.html#instant-run">Instant Run</a> Jack 180 181 182 </p> 183 184 <p>Jack Jack 185 186 </p> 187 188 <ul> 189 <li> Lint Detector 190 </li> 191 192 <li>JaCoCo 193 194 </li> 195 </ul> 196 197 <p>Jack <a href="http://tools.android.com/filing-bugs"></a></p>