Move install jdk to a function