Enable package pinning of Java

In order to stay at the same version across multiple hosts, I added an ensure on the package.

Note that this is untested and should be merged with caution.

Thanks!