I installed the jdk7u80 the oracle and I wonder what I should do to completely remove it and install the jdk7u76 the oracle?

$ java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

$ javac -version
javac 1.7.0_80

It could be done like this:

Remove the link:

sudo update-alternatives --remove "java" "/usr/lib/jvm/jdk[version]/bin/java"

sudo update-alternatives --remove "javac" "/usr/lib/jvm/jdk[version]/bin/javac"

sudo update-alternatives --remove "javaws" "/usr/lib/jvm/jdk[version]/bin/javaws"

Then, remove the package in the /usr/lib/jvm

sudo rm -r /usr/lib/jvm/jdk[version]

Note :

Change [version] with any version number that's contained in jdk folder's name, example : jdk[version] = jdk1.7.0_13

For installation specific java file:

  1. Download it from here.
  2. Optional (if you are not logged as root you need)

    sudo su
  3. Untar the package tar -zxf jdk-7u76-linux-x64.tar.gz -C /opt/jdk

  4. Set Oracle's Java as default

    update-alternatives --install /usr/bin/java java  /opt/jdk/[version]/bin/java 100

    update-alternatives --install /usr/bin/javac javac /opt/jdk/[version]/bin/javac 100

  5. Check Java version if it is ok

    java -version 

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.