EU docs
1<dependency>2 <groupId>com.launchdarkly</groupId>3 <artifactId>launchdarkly-java-server-sdk</artifactId>4 <version>7.0.0</version>5</dependency>
1import com.launchdarkly.sdk.*;2import com.launchdarkly.sdk.server.*;34public class Main {5 public static void main(String[] args) {6 LDConfig config = new LDConfig.Builder().build();78 // This is your LaunchDarkly SDK key.9 // Never hardcode your SDK key in production.10 final LDClient client = new LDClient("YOUR_SDK_KEY", config);1112 if (client.isInitialized()) {13 // For onboarding purposes only we flush events as soon as14 // possible so we quickly detect your connection.15 // You don't have to do this in practice because events are automatically flushed.16 client.flush();17 System.out.println("SDK successfully initialized!");18 }19 }20}
You can find your server-side SDK keys, mobile keys, and client-side ID on the SDK keys page under Settings.
To learn more, read Initialize the client in the Java SDK reference guide.