Ubuntu: Change update-java-alternatives prio



Question:

karl@karl-Dell-Precision-M3800:~$ update-java-alternatives -l  java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64  java-6-oracle                  1085       /usr/lib/jvm/java-6-oracle  java-7-oracle                  1083       /usr/lib/jvm/java-7-oracle  java-8-oracle                  1086       /usr/lib/jvm/java-8-oracle  java-9-oracle                  1084       /usr/lib/jvm/java-9-oracle  

I'd like to set java-1.8.0-openjdk-amd64 as 1090. I've tried update-alternative install but it won't change.


Solution:1

You can either override the automatic choice based on the priority value by setting the alternative manually:

update-java-alternatives --set java-1.8.0-openjdk-amd64   

Or you can change the priority of each entry by manually editing the appropriate configuration file in /usr/lib/jvm, in your case that would be /usr/lib/jvm/.java-1.8.0-openjdk-amd64.jinfo.

Open it in your favourite text editor as root and change the line

priority=1081  

to your needs. It should be near the top of the file, probably line 3.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »