As you asked for java solution, I can recommend OpenCV
]. And here you have a good tutorial about converting an image to binary (black and white) using thresholding, with some theory too: http://docs.opencv.org/doc/tutorials/imgproc/threshold/threshold.html
]. You will notice, that there is no best method
, you will have to choose the most suitable for you. Note, that the samples there are not in Java, but it will be easy to do the same in java since both use OpenCV.
Binarization is in general a special type of image segmentation
], and there are other, more complex aspects of that than thresholding. Please note also, that binarization can be a morphological operation too, like skeleton extraction.
If you don't want OpenCV, look here: http://zerocool.is-a-geek.net/?p=376
[update: important link was missing]