No Java is required. Just having two files open for reading at the same time.
alans-imac:Hancock Purchase alan$ ls -l
total 46384
-rw-r--r--@ 1 alan staff 6751993 Aug 7 2013 Deed.pdf
-rw-r--r--@ 1 alan staff 16992003 Aug 7 2013 Settlement.pdf
drwxr-xr-x 5 alan staff 170 Jul 7 2013 Verification
alans-imac:Hancock Purchase alan$ cmp Deed.pdf Settlement.pdf
Deed.pdf Settlement.pdf differ: char 94, line 6
alans-imac:Hancock Purchase alan$ ls -l
total 46384
-rw-r--r--@ 1 alan staff 6751993 Aug 7 2013 Deed.pdf
-rw-r--r--@ 1 alan staff 16992003 Feb 9 07:35 Settlement.pdf
drwxr-xr-x 5 alan staff 170 Jul 7 2013 Verification