How to revert back to OpenJDK?

Solution 1:

Use

 update-java-alternatives 

to switch between different implementations without removing or reinstalling and downloading packages.

Solution 2:

In order to switch between installed Java versions, you can use the update alternatives command.

  • To obtain a list of the installed Java packages on a system, run the following command from the terminal(Ctrl-Alt-t):

    sudo update-alternatives --config java
    

    This will give a list output similar to the following:

    There are 4 choices for the alternative java (providing /usr/bin/java).
       Selection    Path                                           Priority   Status
      ------------------------------------------------------------
      0            /usr/lib/jvm/java-7-oracle/jre/bin/java         1070      auto mode
      1            /usr/lib/jvm/java-7-openjdk-i386/jre/bin/java   1051      manual mode
    * 2            /usr/lib/jvm/java-7-oracle/jre/bin/java         1069      manual mode
    Press enter to keep the current choice[*], or type selection number: 
    

In this particular case, the Oracle Java 7 version is the current default(indicated by the asterisk).

In order to switch to the OpenJDK version, you would select option 1 at the prompt and press the Enter key.

You will now be running the OpenJDK 7 version.

No other changes will be needed to switch your Java versions.