Hi @Ey Thank you for posting your question.
Please try the below samples using either an IDE (Eclipse, IntelliJ, or VSCODE) or from the command line using Maven.
These environment variables must be set
ACCOUNT_HOST=your account hostname;ACCOUNT_KEY=your account primary key (https://learn.microsoft.com/en-us/azure/cosmos-db/sql-api-java-sdk-samples)
/ Create sync client
// <CreateSyncClient>
client = new CosmosClientBuilder()
.endpoint(AccountSettings.HOST)
.key(AccountSettings.MASTER_KEY)
.preferredRegions(preferredRegions)
.consistencyLevel(ConsistencyLevel.EVENTUAL)
.contentResponseOnWriteEnabled(true)
.buildClient();
Please refer to the below link for java Quickstart examples.
Regards,
Oury