The is a Java program that searches for magic squares.
You can read more about it on my page (in Romanian). Sorry about the bad code, I wrote it a while ago.
Run the Swing GUI:
java -cp target/magic-square-*.jar net.nechifor.magic_square.Main
Try it from the console:
java -cp target/magic-square-*.jar net.nechifor.magic_square.Console BIHC 16