Skip to content

Instantly share code, notes, and snippets.

@schnell18
Created October 8, 2016 13:26
Show Gist options
  • Select an option

  • Save schnell18/bcb9833f725be22f6acd01f94b486392 to your computer and use it in GitHub Desktop.

Select an option

Save schnell18/bcb9833f725be22f6acd01f94b486392 to your computer and use it in GitHub Desktop.
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
@connor11528
Copy link
Copy Markdown

For me on first line had to run

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

Otherwise works great!

@mihirp1730
Copy link
Copy Markdown

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

@cemceliks
Copy link
Copy Markdown

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
Copy link
Copy Markdown

thank you

@SumeetSandhu
Copy link
Copy Markdown

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
Copy link
Copy Markdown

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
Copy link
Copy Markdown

Thanks!!!

@umutyerebakmaz
Copy link
Copy Markdown

Big Thanks!!!

@rahulsh1
Copy link
Copy Markdown

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

@TheOmarStack
Copy link
Copy Markdown

thanks!!

@palmipode
Copy link
Copy Markdown

thanks a lot.

Regards.

@p-b-west
Copy link
Copy Markdown

p-b-west commented Feb 2, 2018

Thanks rahulsh1! That's neat.

@thinklinux
Copy link
Copy Markdown

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

@kaunjovi
Copy link
Copy Markdown

kaunjovi commented Feb 7, 2018

Thanks. This helped.

@jd4d
Copy link
Copy Markdown

jd4d commented Feb 13, 2018

+1 super helpful @mgela @schnell18

@TONYHOKAN
Copy link
Copy Markdown

Thanks!

Save me a lot of time.

@TheoGit
Copy link
Copy Markdown

TheoGit commented Feb 22, 2018

woo hoo! thanks! very helpful!

@jialinxie
Copy link
Copy Markdown

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
Copy link
Copy Markdown

My hero.

@yehgdotnet
Copy link
Copy Markdown

yehgdotnet 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
Copy link
Copy Markdown

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
Copy link
Copy Markdown

impaler 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
Copy link
Copy Markdown

Works like a charm!

@komendantaa
Copy link
Copy Markdown

Many Thanks!!!

@AndreFSilveira
Copy link
Copy Markdown

Thanks :)

@muralibala
Copy link
Copy Markdown

Awesome. Thanks a lot.

@Salomao123
Copy link
Copy Markdown

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

@Justin-Schmitz
Copy link
Copy Markdown

You sir are a LEGEND!

@cyb3rsalih
Copy link
Copy Markdown

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

@care4tauren
Copy link
Copy Markdown

Whaaat... And that's it? People have you ever heard of time machine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment