Official Weaviate Java Client.
To start using Weaviate Java Client add the dependency to pom.xml:
<dependency>
<groupId>io.weaviate</groupId>
<artifactId>client6</artifactId>
<version>6.0.0-beta4</version>
</dependency>If you're building a uber-JAR with something like maven-assembly-plugin, use a shaded version with classifier all.
This ensures that all dynamically-loaded dependecies of io.grpc are resolved correctly.
The latest development version of client6 is released after every merged pull request. Set the version to 6.0.0-SNAPSHOT to include it in your project.
Please be mindful of the fact that this is not a stable release and breaking changes may be introduced.
Snapshot releases overwrite each other, so no two releases are alike. If you find a bug in one of the SNAPSHOT versions that you'd like to report, please include the output of Debug.printBuildInfo() in the ticket's description.
import io.weaviate.client6.v1.internal.Debug;
public class App {
public static void main(String[] args) {
Debug.printBuildInfo();
// ...the rest of your application code...
}
}The client uses Google's gson for JSON de-/serialization which does reflection on internal java.lang classes. This is not allowed by default in Java 9 and above.
To work around this, it's necessary to add this JVM command line argument:
--add-opens=java.base/java.lang=ALL-UNNAMED
If you're using Gradle, you can add this instead to your application block in your build.gradle.kts file:
applicationDefaultJvmArgs += listOf(
"--add-opens=java.base/java.lang=ALL-UNNAMED",
)