Yes the linked question you have posted is the way to go. Local features might not work very well for your case (sheet of paper), if it doesn't maybe you should do a kind of row scanner where you compare a few rows from one image to rows of the other image until the row comparison has a similarity above some threshold. Basically finding where the images should intersect.
For Java image stitching you might check this OpenCV alternative: BoofCV
Or this dedicated stitching library: Hugin
At worst case you can check how they do the stitching and code yourself a simpler version.