I've recently had my Mac scanned for a corporate compliance test and the older Java 8 JDK has come up as a failure point. Even though I had newer JDKs installed, it meant that I had to go in and uninstall the one that was making me fail this test. There is good documentation online
on how to uninstall a java version on macOS, but I thought that I would walk through the process here anyway...
It looked like I had my default JDK set to the old Java 8 home (running these commands in Terminal.app)...
So what I did first was remove that export line from the ~/.zprofile
script. Then using the java_home
utility, I was able to list all of the java installations that I had...
That's quite a few! (also I didn't know that some of these were even installed!)
Using the Terminal.app
again, I was able to simply delete the JDKs that I didn't want installed by using the rm
command and passing in the Home
directory of the JDK to delete (using sudo of course, and entering your admin user password), for example...
I proceeded to delete all but the latest JDK using this method. There was nothing else to do after this, the JDK was simply gone!
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
If you spot something out of place, please do let me know.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...