Compliation fixes for java examples

build scripts for scala and java examples are more similar
made minor changes in RandomWalk.java for successful compilation
added a gitignore entry for generated classes in java examples