Skip to content

Commit cc83a99

Browse files
fix: Use LAUNCHDARKLY_SDK_KEY instead
1 parent 0c666cc commit cc83a99

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Below, you'll find the basic build procedure, but for more comprehensive instruc
88

99
This project uses [Gradle](https://gradle.org/). It requires that Java is already installed on your system (version 8 or higher). It will automatically use the latest release of the LaunchDarkly SDK with major version 7.
1010

11-
1. Set the value of environment variable `LAUNCHDARKLY_SERVER_KEY` to your LaunchDarkly SDK key. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, edit `src/main/java/Hello.java` and set `FEATURE_FLAG_KEY` in code to the flag key.
11+
1. Set the value of environment variable `LAUNCHDARKLY_SDK_KEY` to your LaunchDarkly SDK key. If there is an existing boolean feature flag in your LaunchDarkly project that you want to evaluate, edit `src/main/java/Hello.java` and set `FEATURE_FLAG_KEY` in code to the flag key.
1212

1313
```sh
14-
export LAUNCHDARKLY_SERVER_KEY=1234567890abcdef
14+
export LAUNCHDARKLY_SDK_KEY=1234567890abcdef
1515
```
1616

1717
```java

src/main/java/Hello.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ private static void showBanner() {
2929
}
3030

3131
public static void main(String... args) throws Exception {
32-
// Set this environment variable to skip the loop process and evaluate the flag
33-
// a single time.
3432
boolean CIMode = System.getenv("CI") != null;
3533

36-
// Get SDK Key from env variable LAUNCHDARKLY_SERVER_KEY
37-
String envSDKKey = System.getenv("LAUNCHDARKLY_SERVER_KEY");
34+
String envSDKKey = System.getenv("LAUNCHDARKLY_SDK_KEY");
3835
if(envSDKKey != null) {
3936
SDK_KEY = envSDKKey;
4037
}
@@ -47,7 +44,7 @@ public static void main(String... args) throws Exception {
4744
LDConfig config = new LDConfig.Builder().build();
4845

4946
if (SDK_KEY == null || SDK_KEY.equals("")) {
50-
showMessage("Please set the LAUNCHDARKLY_SERVER_KEY environment variable or edit Hello.java to set SDK_KEY to your LaunchDarkly SDK key first.");
47+
showMessage("Please set the LAUNCHDARKLY_SDK_KEY environment variable or edit Hello.java to set SDK_KEY to your LaunchDarkly SDK key first.");
5148
System.exit(1);
5249
}
5350

0 commit comments

Comments
 (0)