I have set of newick files and I want to convert them into distance matrix. I'm implementing my application in Java, so if there is any library in Java, it would be great.
I don't know about JAVA but in python you can read the tree with the dendropy module and then for each pair of leaf nodes find the most recent common ancestor and compute the distance from it to each of the nodes which will give you their distance.