Well, you just answered your question yourself.
For Jive 5 and higher, use the core v2 api. Example on the Jive community: https://community.jivesoftware.com/api/core/v2/communications
For Jive 6, Jive Cloud and higher, use the core v3 api: https://community.jivesoftware.com/api/core/v3/inbox
These return the elements in your communications view (Jive5) or Inbox (Jive 6) in Json Format.
You can find the documentation for both at developers.jivesoftware.com
Pretty much all current programming environments offer rich support for working with JSON data in Restful webservices, so you can pick your favorite here.
How to invoke it using java ? Also the authentication is happening using SAML plugin Jive 5. How to pass on the user credentials.
any references would be helpful.