This is an update to a post from 2011-03-15 - A Java program to recursively find all duplicate files in a directory.

On August 4 Kelvin Goodson emailed me a modified version which does not read the entire file to memory to make a hash. This prevents out of memory errors, but is slower. Therefore I leave both versions, with the memory-friendly version as the default, but you can switch back to cpu-friendly by executing with a ‘-quick’ command line flag:

java FindDuplicates path/to/files -quick