Install Java alternatives

Error:

update-alternatives: error: alternative javaws can't be master: it is a slave of javaplugin

or

update-alternatives: error: alternative jar can't be master: it is a slave of javac

Solution:

update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.8.0_51/bin/java" 1

update-alternatives --install "/usr/lib64/browser-plugins/javaplugin.so" "javaplugin" "/usr/java/jdk1.8.0_51/jre/lib/amd64/libnpjp2.so" 1 --slave "/usr/bin/javaws" "javaws" "/usr/java/jdk1.8.0_51/bin/javaws"

update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk1.8.0_51/bin/javac" 1 --slave "/usr/bin/jar" "jar" "/usr/java/jdk1.8.0_51/bin/jar"

Note:

1 – is the priority

Please change the paths as required on your operation system

Change java alternatives:


update-alternatives --config java

update-alternatives --config javac

update-alternatives --config javaplugin