"Java for macOS 2017-001 can't be installed on this disk: A newer version of this package is already installed". Cannot install common fix to: "To use the java command-line tool, you need to install a JDK" after updating to Catalina
So far, after updating macOS (Sierra, Capitan, Yosemite, etc..) I have dealt with the "To use the java command-line tool, you need to install a JDK" pop up by installing the Java for OS X 2017-001 aka Apple’s version of Legacy Java Command-line tool. However, after installing Catalina, this fix cannot be installed. During installation, I get: "Java for macOS 2017-001 can't be installed on this disk: A newer version of this package is already installed".
See screenshot:
I have tried uninstalling Java using the command lines:
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
sudo rm -fr ~/Library/Application\ Support/Oracle/Java
But this does not seem to work. I get the same "Java for macOS 2017-001 can't be installed on this disk: A newer version of this package is already installed" message.
Has anyone else ran into the same issue?