Uninstall Java 8 properly. Fixes #3760