How to remove Java 10? Or revert to the previous version?
I believe the problem is navigating to the correct directory... Once you are where you are supposed to be you can run the sudo commands to remove whichever versions of java you want to remove. 

First, run the command in the terminal to determine which version of Java you are running,

java -version


then you can navigate to pesky version of java that you intend to delete by using the following command:

cd /Library/Java/JavaVirtualMachines


then once you see are in the JavaVirtualMachines path, type in ls to see what versions of Java you have installed, 

ls


and finally when you know which version or versions of Java you want to uninstall:

sudo rm -rf jdk-10.0.1.jdk #or whichever version you want to delete