Java JSON Tutorial

java json tutorials

JSON (JavaScript Object Notation), is a simple and easy to read and write data exchange format. It’s popular and implemented in countless projects worldwide, for those don’t like XML, JSON is a very good alternative solution.

In this series of Java JSON tutorials, we focus on three popular third party Java libraries to process JSON data, which are Jackson, Google Gson and JSON.simple


A High-performance JSON processor.

Google Gson

It was originally created for use inside Google, now it is used by many public projects.


Simple Java library for JSON, to read and write JSON data.


  1. Introducing JSON
  2. JSON described in RFC 4627
  3. JSON Wiki
  4. Jackson official website
  5. Gson official website
  6. JSON.simple official website
  7. Review of 5 Java JSON libraries
  8. Jackson vs Gson
Tags :

About the Author

Founder of and, love Java and open source stuff. Follow him on Twitter, or befriend him on Facebook or Google Plus. If you like my tutorials, consider make a donation to these charities.


  • Pingback: water ionizer()

  • Pingback: ionizer loans()

  • Pingback: HD Coloring Pages()

  • Pingback: house blue()

  • Pingback: zak?ad szklarski piotrków trybunalski()

  • Pingback: water ionizer plans()

  • Pingback: liquid plumber hair clog()

  • Pingback: see this here()

  • Pingback: b&i locksmith()

  • Pingback: double d locksmith sandy oregon()

  • Pingback: electrician engineer()

  • Pingback: electrician apprenticeship ma()

  • Pingback: stop parking()

  • Pingback: pay per day loan plans()

  • Pingback: alkaline water brands()

  • Pingback: paypal loans()

  • Pingback: laan penge nu sms()

  • Pingback: xnxx()

  • Pingback: parking()

  • Pingback: tv packages()

  • Pingback: uk online casinos()

  • Pingback: vpn service()

  • Pingback: enagic kangen water()

  • Pingback: kangen water machine()

  • Pingback: alkaline()

  • Pingback: alkaline water()

  • Pingback: watch free movies online()

  • Pingback: watch tv show episodes()

  • Pingback: Learn More()

  • Pingback: Blue Coaster33()

  • Sujata Sid

    It’s Really Helpfull Tutorial!!!!!!!!!!!

  • Android Guru

    You can start learning Android programming from scratch through this blog –
    Blog is targetted for Freshers or novice programmers who want to begin learning Android application development.

  • Vishal

    To develop a webservice using java to fetch the data from json array and store that data on the database…

  • nirmal
  • Rituranjan
  • Anuj

    This code works fine for me

    	public Response getList() {
    		List<Person> personArray = new ArrayList<Person>();
    		Person p1 = new Person();
    		p1.setName("First Person");
    		Person p2 = new Person();
    		p2.setName("Second Person");
    		Person p3 = new Person();
    		p3.setName("Third Person");
    		GenericEntity entity = new GenericEntity<List<Person>>(personArray){};
    		return Response.ok(entity).build();

    Where as if I change Media Type to JSON, it throws error -500.

    16558 [http-8080-2] ERROR org.apache.wink.server.internal.handlers.FlushResultHandler – The system could not find a or a DataSourceProvider class for the java.util.ArrayList type and application/json mediaType. Ensure that a exists in the JAX-RS application for the type and media type specified.

  • Bhagavan

    Nice one

  • felix

    if the value has a double quotation(“), which function should I use?
    thanks :)

  • Laxman Chowdary

    You are just posting, we followed you, become victims while developing the applications.
    We got the following error.If we would have followed,JDK JSON we might not face this problem… circular reference error
    • Laxman Chowdary

      I realized that this is not your mistake, Googles product bug…
      Inconvenience regretted..

      • Sara Ali

        Laxman, he is only helping you and before posting any anything you should have been sure !

  • jyothsana

    Thanks Mkyong… This site is really very useful for all the queries related to JSON..

    • Shubhrajyoti satpathy


  • sagar srinivas


    My doubt on struts2 jquery grid. I want to get the column names of a grid from struts2 Action class.
    Please help me
    how to get property names of Action class or DAO class.
    based on the property names i generate grid dynamically.

    Thank u…..

  • Bhaskar Reddy

    Really its a very good tutorial …… Thank you so much.

  • tttrung43

    Thank you so much.
    This tutorial is very useful with me.

  • Pingback: Sekilas tentang Java JSON « Programming, Inspiring and more…()

  • rojer

    very nice for understanding i never see like this before.

  • Sylar

    Implementing an interface means overiding its methods. So @overide was used.

    • chandan singh

      we can not override abstract methods we can implement abstract methods.

  • ????

    you are a very good engineer.

  • Pingback: Links for August 9th through August 12th — Vinny Carpenter's blog()

  • Pingback: Blog bookmarks 08/13/2011 « My Diigo bookmarks()

  • Muskandaza

    Excellent , mkyong @ BEST . Really Appreciable .Tons of Best Wishes.