简体   繁体   中英

Cannot resolve some classes of jdk 8 in android studio

I am using jdk1.8.0_31. But i cannot implement class in my project YearMonth which introduced in jdk 1.8. My concept on jdk is not clear. Is there any relationship between jdk version vs api version (Compatibility issues) ? Is the all features are inherited in android after release of latest jdk ?

If you go to File/project structure in android studio and for source compatibility select 1.8 you can't because android studio doesn't. This lawsuit explains why google is not so eager to support java for now. As for time/year/month/dates etc. Java 8 has instant for recording times and dates ...

Check your android API and see what java versions are supported. Most of the time when an api is designed a lot of efforts put in place to support lower JDK(specially > JDK 1.5) versions but the people don't have control on latest Java versions.

Minimum SDK level defines what you can use or not. Java 8 is currently not supported by Android. Please refer the below post for more details

Which JDK version (Language Level) is required for Android Studio?

API level with JRE versions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM