Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Java 6 #2018

Closed
eamonnmcmanus opened this issue Nov 9, 2021 · 2 comments · Fixed by #2043
Closed

Drop support for Java 6 #2018

eamonnmcmanus opened this issue Nov 9, 2021 · 2 comments · Fixed by #2043

Comments

@eamonnmcmanus
Copy link
Member

Continuing to support Java 6 causes considerable headaches. Building with -source 6 -target 6 is not supported in JDK versions after 11. I don't think we need to support further back than Java 7 even for the most ancient Android devices still in use.

@Marcono1234
Copy link
Collaborator

I don't think we need to support further back than Java 7 even for the most ancient Android devices still in use.

Would it make sense to directly move to Java 8? Then Gson could in the future easily add support for Optional (#1102) and the java.time package (#1059), possibly by integrating https://github.com/google-gson/typeadapters.

@eamonnmcmanus
Copy link
Member Author

I think we'll want Gson to be like Guava. Guava supports Java 7 for Android. In reality, Android tooling does support Java 8 language features such as lambdas even for old Android versions, but those old versions don't have Java 8 API features such as java.util.Optional and java.time. If we wanted to support those, I think we would either have to use reflection or have separate artifacts for Java 7 and Java 8.

At some point, Guava will probably stop supporting these old versions and then Gson can follow suit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants