Guides
Submit FeedbackJoin Developer Community

Install SDK

The Java SDK is distributed through Bintray. The core-api and httpclient Bintray packages are optimizely-sdk-core-api and optimizely-sdk-httpclient, respectively. You can find repository information and also instructions on how to install the dependencies on Bintray. Gradle repository and dependency configurations are shown on the right. The SDK is compatible with Java 1.8 and above.

core-api requires org.slf4j:slf4j-api:1.7.16 and a supported JSON parser. We currently integrate with these parsers (listed in their selection order priority):

  1. Jackson
  2. GSON
  3. json.org
  4. json-simple

If more than one of these parsers are available at runtime, the core-api chooses one for use per the selection order priority. If none of these packages are already provided in your project's classpath, you must add one.

📘

Moving to MavenCentral

Bintray/JCenter will be shut down. The publish repository has been migrated to MavenCentral for the SDK version 3.8.1 or later. Older versions will be available in JCenter until February 1st, 2022.

repositories {
    mavenCentral()
    jcenter()
}

dependencies {
    compile 'com.optimizely.ab:core-api:3.8.2'
    compile 'com.optimizely.ab:core-httpclient-impl:3.8.2'
    compile 'org.apache.httpcomponents:httpclient:4.5.6'

    // The SDK integrates with multiple JSON parsers. Here, we use Jackson.
    compile 'com.fasterxml.jackson.core:jackson-core:2.9.8'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.9.8'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.9.8'

    compile 'org.slf4j:slf4j-api:1.7.16'
    compile 'ch.qos.logback:logback-classic:1.1.7'
}

The full source code is at https://github.com/optimizely/java-sdk.


Did this page help you?