The solution presented in Convert a string list/set to json objects in java seems not to work with javax.json.
In version 1.1.4 of the javax.json JSONObject is a subclass of the typed Map<String, JsonValue>.
Hence
jsonObject.put("key", "value")
leads to an error, because put expects now an Json Object as the second object.
However, I did not find an easy way to convert a simple String into a JsonValue.
What is the best way to create a simple JsonValue?
Wallenstein
jackson, notjavax.json, why do you expect that solution to work?