Ubuntu 16.04. I was trying to run pycharm, and realized that I must have corrupted my jre at some point. Even after doing:

sudo apt purge openjdk-8-jre

running java -version gives me:

nick@imipramine:~$ java -version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)

How can I completely remove all Java jres and jdks from my system before re-installing? Or am I missing something super basic?

BTW, I tried:

apt purge openjdk-9-internal
apt purge openjdk-9-jre openjdk-9-jdk

And openjdk-8-jdk.

Some files were removed, but java -version still reports that openjdk is installed!


Assuming you did not build OpenJDK from source, this will uninstall any package starting with openjdk:

sudo apt remove --purge "^openjdk.*"

Including any program depending on a Java runtime environment.

| improve this answer | |
  • Thank-you! That worked. I then did "sudo apt install default-jre" and PRESTO... pycharm is up and running. – Nick Chackowsky May 29 '16 at 0:42
  • 2
    @NickChackowsky If this solved your problem please mark the answer as correct by clicking on the checkmark to its left. Putting SOLVED in the question title is not how it works here. – Organic Marble May 29 '16 at 2:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.