Legacy Dev Forum Posts

 View Only

Sign Up

Java SDK Stable Release (1.0.0+)

  • 1.  Java SDK Stable Release (1.0.0+)

    Posted 06-05-2025 18:11

    tim.smith | 2017-04-20 22:25:35 UTC | #1

    The Java SDK is officially released as of v1.0.0. This official release comes with several changes:

    • The package is now com.mypurecloud:platform-client-v2. The v2 in the package name refers to the Platform API major version, not the SDK version.
    • New repository for source code and releases: https://github.com/MyPureCloud/platform-client-sdk-java
    • New documentation URL: https://developer.mypurecloud.com/api/rest/client-libraries/java/
    • ApiClient now implements a builder pattern for any usage other than the default constructor
    • All request methods now accept a request object that implement a builder pattern
    • Models now implement the PagedResource<T> interface if the model is conformant
    • The SDK supports your choice of Apache (default, sync), Ning (async), or OkHTTP (sync) client connectors
    • General improvements to the SDK
    • Some method names on the API classes have changed. The purpose of this change was to generally make the method names more consise. There is a source code upgrade script available that will attempt to upgrade method names from the old method names to the new method names. More information can be found at https://github.com/MyPureCloud/sdk-upgrade-script
    • As of SDK version 5.0.1, the Java SDK may be used in Android applications built with Android Studio 2.4 Preview 6 or later.

    Note: The old package, com.mypurecloud:platform-client, will continue to be available on maven central, but will not recieve any updates.


    skansakar | 2017-05-18 14:03:17 UTC | #2

    Does the SDK have a dependency on Java8?


    tim.smith | 2017-05-18 14:40:37 UTC | #3

    There were a handful of builds that targeted Java 8, but the build target was changed back to Java 7 for Android compatibility (5.0.1+).


    skansakar | 2017-05-18 14:46:32 UTC | #4

    I am trying version 8.0.0 of platform-client-v2 and getting the following error when trying to call the Organization API. It seem to be rely on putIfAbsent method which is only available in Java8?

    Any ideas?

    2017-05-18 14:51:46,957 TRACE EXCP:ExceptionOccured 2017-05-18 14:51:46,958 TRACE java.lang.RuntimeException: java.lang.NoSuchMethodError: java.util.Map.putIfAbsent(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; at com.mypurecloud.sdk.v2.api.OrganizationApi.getOrganizationsMe(OrganizationApi.java:185) at com.mypurecloud.sdk.v2.api.OrganizationApi.getOrganizationsMeWithHttpInfo(OrganizationApi.java:138)


    tim.smith | 2017-05-18 15:00:37 UTC | #5

    Hm, I think that's coming from here in ApiClient. Can you confirm that's where the inner exception is coming from in your case?

    That object is just a plain HashMap<String, String>, so it shouldn't be relying on Java 8 functionality. I'll take a look and see if I can figure out why that's being thrown. I've opened API-2594 to investigate.


    skansakar | 2017-05-18 15:39:03 UTC | #6

    Yes, the exception is coming from ApiClient (the line you mentioned).


    skansakar | 2017-05-22 10:58:43 UTC | #7

    @tim.smith is this now confirmed as a bug? Either way, would you have an idea on timescales on when this is likely to be fixed?


    tim.smith | 2017-05-22 17:44:26 UTC | #8

    I've found that the SDK is still actually being compiled using the 1.8 JRE even though the compile target is 1.7. I'm trying to see if I can get it to compile under the 1.7 JRE. If that doesn't work for some reason, it's unlikely that further backporting work will occur; Java 7 is already more than 2 years out of support.


    Terje_Aardal | 2017-05-24 07:11:29 UTC | #9

    @tim.smith have you had the chance to review this further?


    tim.smith | 2017-05-24 14:38:29 UTC | #10

    The Java 8 language constructs have been removed as of 8.0.2.


    system | 2017-08-28 19:34:00 UTC | #11


    This post was migrated from the old Developer Forum.

    ref: 1204