After searching through some existing libraries for JSON, I have finally ended up with these two:
I am a bit partial towards GSON, but word on the net is that GSon suffers from a certain celestial performance issue (as of Sept 2009).
I am continuing my comparison; in the meantime, I'm looking for help to make up my mind.
This question is related to
java
json
comparison
gson
jackson
It seems that GSon don't support JAXB. By using JAXB annotated class to create or process the JSON message, I can share the same class to create the Restful Web Service interface by using spring MVC.
Adding to other answers already given above. If case insensivity is of any importance to you, then use Jackson. Gson does not support case insensitivity for key names, while jackson does.
Here are two related links
(No) Case sensitivity support in Gson : GSON: How to get a case insensitive element from Json?
Case sensitivity support in Jackson https://gist.github.com/electrum/1260489
Gson 1.6 now includes a low-level streaming API and a new parser which is actually faster than Jackson.
Jackson and Gson are the most complete Java JSON packages regarding actual data binding support; many other packages only provide primitive Map/List (or equivalent tree model) binding. Both have complete support for generic types, as well, as enough configurability for many common use cases.
Since I am more familiar with Jackson, here are some aspects where I think Jackson has more complete support than Gson (apologies if I miss a Gson feature):
Source: Stackoverflow.com