1

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 ?

3
  • 2
    Android 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. Commented Feb 17, 2016 at 22:53
  • 1
    JSR-310 is new date time API introduced in Java 8. Android does not ship with Java 8. JodaTime is the recommended library for handling time on Android. Commented Feb 17, 2016 at 23:00
  • There is a JSR-310 backport for Android, and Java 7 in general. Commented Dec 18, 2016 at 22:32

3 Answers 3

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 ...

Sign up to request clarification or add additional context in comments.

Comments

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.

Comments

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?

API level with JRE versions

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.