Friday, August 28, 2015

No Java 8: No JSON for you says Android: UnsupportedClassVersionError: org/json/JSONObject

Let's say you are crazy enough to be running the Ubuntu Long Term Support distribution. Maybe you would even rather like to use the jdk package from the Ubuntu repo so it gets automatically updated? Android says: No; not if you feel like using JSON.

No you won't be able to just change the JSON version in Maven like others who get stuck with it. You will upgrade to JDK 8 or your code will not run. Developer's using JSON: wow, what an edge case, eh? Who would possibly expect Google to conduct enough testing to figure that one out and say "Hey - you have to use JDK 8 to compile from now on".