Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch 1.3.x
‘org.opensearch.client:opensearch-rest-client: 1.3.8’
‘org.opensearch.client:opensearch-java:2.0.0’
Describe the issue:
regarding to Using Different Java Runtimes with OpenSearch · OpenSearch and Installing OpenSearch - OpenSearch documentation, I have chosen to use opensearch-client 1.3.8 , I could have also use high-level REST Client but it will be deprecated and I also will need to use AWS Opensearch, for AWS integration and signing, I guess it is recommended to use opensercah-client
Anyway I can not build the project with gradle 7.5.1 using java 8. Gradle check fails.
So my questions are
- Can you please help me build with java 8 sdk?
- Should I use java-rest-high-level client instead of opensearch-client?
Configuration:
sourceCompatibility = ‘1.8’
targetCompatibility = ‘1.8’
repositories {
mavenCentral()
}
dependencies {
implementation “org.springframework.boot:spring-boot-starter-web”
testImplementation “org.springframework.boot:spring-boot-starter-test”
implementation ‘org.opensearch.client:opensearch-rest-client: 1.3.8’
implementation ‘org.opensearch.client:opensearch-java:2.0.0’
}
Relevant Logs or Screenshots:
gradle build file
plugins {
id ‘java’
id ‘org.springframework.boot’ version ‘2.7.8’
id ‘io.spring.dependency-management’ version ‘1.0.15.RELEASE’
}
group = ‘com.firatsivrikaya.opensearch’
version = ‘0.0.1-SNAPSHOT’
sourceCompatibility = ‘1.8’
targetCompatibility = ‘1.8’
repositories {
mavenCentral()
}
dependencies {
implementation “org.springframework.boot:spring-boot-starter-web”
testImplementation “org.springframework.boot:spring-boot-starter-test”
implementation ‘org.opensearch.client:opensearch-rest-client: 1.3.8’
implementation ‘org.opensearch.client:opensearch-java:2.0.0’
}
tasks.named(‘test’) {
useJUnitPlatform()
}
gradle logs
Could not resolve org.opensearch.client:opensearch-java:2.0.0.
Required by:
project :
No matching variant of org.opensearch.client:opensearch-java:2.0.0 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally but:
- Variant ‘apiElements’ capability org.opensearch.client:opensearch-java:2.0.0 declares an API 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
- Other compatible attribute:
- Doesn’t say anything about its target Java environment (preferred optimized for standard JVMs)
- Variant ‘javadocElements’ capability org.opensearch.client:opensearch-java:2.0.0 declares a runtime of a component, and its dependencies declared externally:
- Incompatible because this component declares documentation and the consumer needed a library
- Other compatible attributes: