public class JaywayJsonpathUsage { /* Given a below json. main method will extract value of json attibute a and prints its value. { "a": 1, "b": 2 } */ public static void main(String[] args) { JsonObject jsonObject = new JsonObject("{\"a\": 1,\"b\":2}"); System.out.println("Printing value of a " + JsonPath.parse(jsonObject.toString()).read("a").toString()); } }