When starting the new Jakarta (9) project, I need to handle old (legacy libraries and modules) using the "javax" JSON-P API. Usually we end with this error:
java: incompatible types: jakarta.json.JsonObject cannot be converted to javax.json.JsonObject
Unfortunately, the old code uses various javax.json.* classes, especially the JsonObjects, that are not usable in the new module's methods (as they are using jakarta.json.JsonObject). We worked this around with producing the string out of the first JsonObject. Then we deserialized it into the other class instance, but is there any other more straightforward way to "retype" or convert the old javax JsonObject instances to new jakarta instances? And vice versa?