Improved ant build and added missing dependency

Hi there Kailash!
I took a look at the Java APIs and made a couple of improvement. I wasn't able to run the ant build straight off the bat, so I improved it so it also did the compiling. Also added a missing dependency.

There are no tests, but I got one of the examples to work, so it should be good!