Hold java packages to speed up build

#625 talks about stopping apt from upgrading Java on every build. This PR implements this.