Convert string to JsonObject
I'm writing a servlet where we are getting a response from a third party API. The response we are getting is in String format, something like - {_ "errors" : [ {_ "message" : "Language encurr=USD is not supported",_ "type" : "UnsupportedLanguageError"_ } ]_}
I need to store this in JsonObject format so that we can access the keys properly.
JsonObject json = new JsonObject(restServiceResponse.getResponseString()); is throwing error.
How can this be attained?