Fix dependencies when installing java