3

did a fresh Ubuntu 17.10 installation a while ago and needed to install Java to build react-native apps on my PC. So I was able to install Java 9 in the manual way by downloading it from the Oracle official site.

Now when I run java --version I get

java 9.0.4
Java(TM) SE Runtime Environment (build 9.0.4+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

and when I run javac --version I get

javac 9.0.4

And then I followed official react docs and created a react app. Then when I try to run it on an android emulator I got an error and I opened a github issue

Seems like it's an issue with Java 9 . So now I need to completely remove java 9 from my PC and install Java 8. How can I completely remove Java 9 from my Ubuntu 17.10 .

P.S :

When I ran sudo dpkg --list | grep -i jdk it showed Java 9. Then I followed this and ran sudo apt-get remove oracle-java9-* and now there's nothing shows when I run sudo dpkg --list | grep -i jdk

1 Answers1

1

You can run below snippet to completely remove Java 9. You will need only one java (10, 9 or 8 whatever you like). Simply, purge everything about java and install fresh one later.

 sudo apt purge java*

You might want to look at this thread as I uninstalled Java 9 and installed new Java 10. https://stackoverflow.com/questions/49507160/how-to-install-jdk-10-under-ubuntu/50452313#50452313