Fixed build script to run properly for Java on linux