-
Notifications
You must be signed in to change notification settings - Fork 222
[PROPOSAL] Restore support for Java 8 #156
Description
What kind of business use case are you trying to solve? What are your requirements?
Many users still need Java 8 for their clients for maximum Java compatibility.
What is the problem? What is preventing you from meeting the requirements?
With the introduction of OpenSearch 2.0.0, the OpenSearch 2.0.0 build has updated to Java 11. This also includes the opensearch-rest-client and opensearch-rest-high-level-client clients.
Users of clients who wish to update their client version must now update to Java 11.
Additionally, the opensearch-java client relies on the opensearch-rest-client. Per opensearch-project/opensearch-clients#17, this is the client which is meant to have the most compatibility.
Here is an example of updating Data Prepper (which currently supports Java 8):
> No matching variant of org.opensearch.client:opensearch-rest-high-level-client:2.0.0-rc1 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally but:
- Variant 'apiElements' capability org.opensearch.client:opensearch-rest-high-level-client:2.0.0-rc1 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
- Variant 'runtimeElements' capability org.opensearch.client:opensearch-rest-high-level-client:2.0.0-rc1 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
What are you proposing? What do you suggest we do to solve the problem or improve the existing situation?
I propose that the OpenSearch Core's opensearch-rest-client and opensearch-rest-high-level-client projects be made to use Java 8. The Gradle build can setup the sourceCompatibility and targetCompatibility to ensure that it uses only Java 8 language features.
An alternative solution would be to remove the dependency that opensearch-java has on opensearch-rest-client.
What are your assumptions or prerequisites?
None.
What are remaining open questions?
Can Gradle toolchains or another mechanism help ensure that the client projects do not use any Java 11 APIs?