Routes API. The Routes API is for calculating driving directions. The Routes API allows you to get route distance calculations, route geometry and step-by-step directions via driving, walking or traffic based algorithms. You can also pass in up to 25 points on your route to calculate a multiple stop route in a single request.
sample:
Take a look at the Microsoft documentation:
http://msdn.microsoft.com/en-us/library/ff701717.aspx It's easy to make this in Java.