Waits for jobs when running java project. Fixes #847