According to mkyong, the magic incantation is defaultPrintingWriter
to pretty print JSON:
Newer versions:
System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(jsonInstance));
Older versions:
System.out.println(mapper.defaultPrettyPrintingWriter().writeValueAsString(jsonInstance));
Seems I jumped the gun a tad quickly. You could try gson, whose constructor supports pretty-printing:
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String jsonOutput = gson.toJson(someObject);
Hope this helps...