Giter Site home page Giter Site logo

launchdarkly / hello-java Goto Github PK

View Code? Open in Web Editor NEW
3.0 46.0 24.0 160 KB

Hello LaunchDarkly for Java

License: Other

Java 100.00%
launchdarkly java example examples feature-flags feature-toggles sdk-examples jvm launchdarkly-sdk managed-by-terraform

hello-java's Introduction

LaunchDarkly sample Java application

We've built a simple console application that demonstrates how LaunchDarkly's SDK works.

Below, you'll find the basic build procedure, but for more comprehensive instructions, you can visit your Quickstart page or the Java SDK reference guide.

Build instructions

This project uses Gradle. 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.

  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.
  export LAUNCHDARKLY_SDK_KEY=1234567890abcdef
  static final String FEATURE_FLAG_KEY = "my-flag";
  1. On the command line, run ./gradlew run (or, on Windows, gradlew run).

You should receive the message "The feature flag evaluates to ." The application will run continuously and react to the flag changes in LaunchDarkly.

hello-java's People

Contributors

aengelberg avatar arun251 avatar atrakh avatar bwoskow-ld avatar drichelson avatar eli-darkly avatar jkodumal avatar kinyoklion avatar kxwu avatar louis-launchdarkly avatar mmrj avatar pkaeding avatar tanderson-ld avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hello-java's Issues

SDK Version in POM 4.8

Online documentation for working with the Launchdarkly SDK shows examples with 4.12.0.

Java SDK dependency version for this project is 4.8.0. A lot of the code examples simply would not compile with 4.8.0. It wasn't until someone else was working with me that they pointed out the dependency version being 4 versions behind the documentation.

naming bug

Hi, this repo is linked in the app Quickstart docs, so noting here a minor naming mismatch between the tutorial project's class file App.java (as downloaded in step 2a: mvn archetype:generate -DgroupId=com.launchdarkly.tutorial -DartifactId=hello-java) compared to the class Hello.java referenced in the Maven Assembly Plugin code in documentation step 2c, line: <mainClass>Hello</mainClass> and step 2e, line: public class Hello {

Was not a big deal to resolve the naming, only detracted a little from the "It Just Works!" feeling when setting up LaunchDarkly for the first time and getting ClassNotFoundException.

When downloading the project, I accepted all default options (Enter) when prompted. Thanks for considering this suggestion for the Quickstart docs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.