How to uninstall Java 9 on macOS Sierra

macOS high sierra removing Java 9:

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

/usr/libexec/java_home -V

The output of the command will be like this

$ /usr/libexec/java_home -VMatching Java Virtual Machines (3):    9.0.4, x86_64: "Java SE 9.0.4" /Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home    1.8.0_161, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home    1.8.0_144, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home

use “Go to” in finder and copy and paste the dir to get there:

2. After deleting Java folder output will be something like this:

$ /usr/libexec/java_home -VMatching Java Virtual Machines (2):    1.8.0_161, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home    1.8.0_144, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home