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 ?
Asked
Active
Viewed 1,817 times
1
-
2Android does not use the latest version of Java. There is a large delay between when a version of Java is released, and when Android officially supports it. – Andrew Williamson Feb 17 '16 at 22:53
-
1[`JSR-310`](https://dzone.com/articles/introducing-new-date-and-time) is new date time API introduced in Java 8. Android does not ship with Java 8. [JodaTime](https://github.com/dlew/joda-time-android) is the recommended library for handling time on Android. – Eugen Pechanec Feb 17 '16 at 23:00
-
There is a JSR-310 backport for [Android](https://github.com/JakeWharton/ThreeTenABP), and [Java 7](http://www.threeten.org/threetenbp/) in general. – drhr Dec 18 '16 at 22:32
3 Answers
2
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 ...

Pomagranite
- 696
- 5
- 11
1
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.

Yohannes Gebremariam
- 2,225
- 3
- 17
- 23
1
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?

Community
- 1
- 1