Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
MacOS X remove Java 9
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.jdk/
sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane
@JohnMCrooks

This comment has been minimized.

Copy link

commented Oct 5, 2017

If I remove it this way will it affect the other versions I have installed?

@silkyland

This comment has been minimized.

Copy link

commented Oct 11, 2017

Luv ya

@kikoseijo

This comment has been minimized.

Copy link

commented Oct 14, 2017

You can always fake it using the JAVA_HOME,

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home
@patr1ckm

This comment has been minimized.

Copy link

commented Oct 26, 2017

Nailed it, thanks.

@alexec

This comment has been minimized.

Copy link

commented Nov 1, 2017

Excellent - ty.

@AlisonZ

This comment has been minimized.

Copy link

commented Nov 3, 2017

I have tried removing Java using these steps and setting the JAVA_HOME to a different version and neither are working? Any ideas of where else to look?

@denisshirokikh

This comment has been minimized.

Copy link

commented Nov 3, 2017

Thanks!!

@PaijoRX

This comment has been minimized.

Copy link

commented Nov 6, 2017

thanks

@maddydixit800788

This comment has been minimized.

Copy link

commented Nov 8, 2017

thanks !!!!!
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_{ should be your version }.jdk/Contents/Home

@JimmySorza

This comment has been minimized.

Copy link

commented Nov 15, 2017

Thanks!!

@cwbit

This comment has been minimized.

Copy link

commented Nov 18, 2017

+1 thanks for this
Don't forget to check the /Library/Java/JavaVirtualMachines/ manually and see what your real JDK version is. Mine wasn't 9 it was 9.something

@anandsunderraman

This comment has been minimized.

Copy link

commented Nov 27, 2017

bitmoji

@tushartripathi1998

This comment has been minimized.

Copy link

commented Nov 28, 2017

thanks !
Finally it worked ! Thanks a ton ! @cwbit, thank you too .

@devendralattu

This comment has been minimized.

Copy link

commented Nov 28, 2017

My java version was 9.0.1:
sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/

@mgela

This comment has been minimized.

Copy link

commented Nov 30, 2017

@devendralattu

sudo rm -rf /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/

fixed

@jonathandion

This comment has been minimized.

Copy link

commented Dec 12, 2017

@mgela thanks.

@dotandpixel

This comment has been minimized.

Copy link

commented Dec 14, 2017

Thanks for this code, and also @cwbit for the specific tip around version.

@Vyacheslavna

This comment has been minimized.

Copy link

commented Dec 18, 2017

thanks a lot!

@connor11528

This comment has been minimized.

Copy link

commented Dec 18, 2017

For me on first line had to run

sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk

Otherwise works great!

@mihirp1730

This comment has been minimized.

Copy link

commented Dec 19, 2017

thank you so much, this is the lifesaver for me. @mgela

@cemceliks

This comment has been minimized.

Copy link

commented Dec 29, 2017

Hi guys I have the same issue with JDK 9.0.1. Not clear what the solution is. I tried to update the bash_profile as recommended shortcut but not working for me.

@fuatkarakus

This comment has been minimized.

Copy link

commented Jan 1, 2018

thank you

@SumeetSandhu

This comment has been minimized.

Copy link

commented Jan 7, 2018

it is a nightmare trying to remove jdk-9.0.1_osx-x64_bin.dmg and install jre-8u151-macosx-x64
the instructions above (= also on java.com for versions 7,8) do not work :(

@stephensayhello

This comment has been minimized.

Copy link

commented Jan 10, 2018

it is a nightmare trying to remove jdk-9.0.1_osx-x64_bin.dmg and install jre-8u151-macosx-x64
the instructions above (= also on java.com for versions 7,8) do not work :(

for macOS high sierra removing java 9:
delete the java folder you find in the dir shown to you after executing:
/usr/libexec/java_home -V
use "Go to" in finder and copy and paste the dir to get there

@victorcs85

This comment has been minimized.

Copy link

commented Jan 12, 2018

Thanks!!!

@umutyerebakmaz

This comment has been minimized.

Copy link

commented Jan 16, 2018

Big Thanks!!!

@rahulsh1

This comment has been minimized.

Copy link

commented Jan 23, 2018

To disable it, you can rename the Info.plist to Info.plist.disabled in /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/
It then stops listing under /usr/libexec/java_home

@duarte171183

This comment has been minimized.

Copy link

commented Jan 31, 2018

thanks!!

@palmipode

This comment has been minimized.

Copy link

commented Feb 1, 2018

thanks a lot.

Regards.

@p-b-west

This comment has been minimized.

Copy link

commented Feb 2, 2018

Thanks rahulsh1! That's neat.

@thinklinux

This comment has been minimized.

Copy link

commented Feb 5, 2018

Thanks! I needed to delete the whole Java folder to get rid of JDK 9... but... that's life :D

@kaunjovi

This comment has been minimized.

Copy link

commented Feb 7, 2018

Thanks. This helped.

@jd4d

This comment has been minimized.

Copy link

commented Feb 13, 2018

+1 super helpful @mgela @schnell18

@TONYHOKAN

This comment has been minimized.

Copy link

commented Feb 18, 2018

Thanks!

Save me a lot of time.

@TheoGit

This comment has been minimized.

Copy link

commented Feb 22, 2018

woo hoo! thanks! very helpful!

@jialinxie

This comment has been minimized.

Copy link

commented Mar 1, 2018

i found a simplest way.

for macOS high sierra removing java 9:

delete the java folder you find in the dir shown to you after executing:

/usr/libexec/java_home -V

use "Go to" in finder and copy and paste the dir to get there

@nickenchev

This comment has been minimized.

Copy link

commented Mar 2, 2018

My hero.

@yehgdotnet

This comment has been minimized.

Copy link

commented Mar 11, 2018

$ sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9*.jdk/
$ sudo rm -fr /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
$ sudo rm -fr /Library/PreferencePanes/JavaControlPanel.prefPane

$ /usr/libexec/java_home -V
Unable to find any JVMs matching version "(null)".
Matching Java Virtual Machines (0):
Default Java Virtual Machines (0):
No Java runtime present, try --request to install

@srinath815

This comment has been minimized.

Copy link

commented Mar 12, 2018

On Mac Terminal
echo $JAVA_HOME

on bash_profile place the below line with your required version
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_{ should be your version }.jdk/Contents/Home
export $PATH=$JAVA_HOME/bin:$PATH

@impaler

This comment has been minimized.

Copy link

commented May 7, 2018

Cheers, this saved me a hassle of reverting back to an older Java version.

I ended up installing java via homebrew brew tap caskroom/versions then brew cask install java8 more here https://www.lonecpluspluscoder.com/2017/10/08/installing-other-versions-of-the-java-jdk-via-homebrew/ and adding it to JAVA_HOME similar to others here.

@edufolly

This comment has been minimized.

Copy link

commented May 23, 2018

Works like a charm!

@komendantaa

This comment has been minimized.

Copy link

commented Jun 1, 2018

Many Thanks!!!

@AndreFSilveira

This comment has been minimized.

Copy link

commented Jun 2, 2018

Thanks :)

@muralibala

This comment has been minimized.

Copy link

commented Jun 2, 2018

Awesome. Thanks a lot.

@Salomao123

This comment has been minimized.

Copy link

commented Jul 13, 2018

sudo rm -fr /Library/Java/JavaVirtualMachines/jdk-9(your version).jdk
thanks for help!

@Justin-Schmitz

This comment has been minimized.

Copy link

commented Jul 23, 2018

You sir are a LEGEND!

@cyb3rsalih

This comment has been minimized.

Copy link

commented Sep 9, 2018

in Turkish we say "ADAMSIN"
Thank you so much!

@kevinpapst

This comment has been minimized.

Copy link

commented Jun 20, 2019

According to this you can also remove sudo rm -fr ~/Library/Application\ Support/Oracle/Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.