How to set default Java version?
Re your first question:
possibly you may be confusing that the webupd8 script is 0.5b. That is the version of the script - it doesnt refer to the java version.
Further to the setting of the javac version.
I suspect you need to explicitly give the path of the javac compiler
i.e.
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/java-6.31-oracle/bin/javac" 1
followed by:
sudo update-alternatives --config javac
With regards to setting up the java chrome plugin.
The master question:
How do I install Oracle JDK 6?
includes this information - since your folder structure is slightly different your link command should be:
ln -s /usr/lib/jvm/java-6.31-oracle/jre/lib/i386/libnpjp2.so ~/.mozilla/plugins/
See this; run
sudo update-java-alternatives --list
to list off all the Java installations on a machine by name and directory, and then run
sudo update-java-alternatives --set [JDK/JRE name e.g. java-8-oracle]
to choose which JRE/JDK to use.
If you want to use different JDKs/JREs for each Java task, you can run update-alternatives to configure one java executable at a time; you can run
sudo update-alternatives --config java[Tab]
to see the Java commands that can be configured (java, javac, javah, javaws, etc). And then
sudo update-alternatives --config [javac|java|javadoc|etc.]
will associate that Java task/command to a particular JDK/JRE.
You may also need to set JAVA_HOME for some applications: from this answer you can use
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:bin/java::")
for JREs, or
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:jre/bin/java::")
for JDKs.
I think you should take a look at the update-java-alternatives
command from the java-common
package and the *.jinfo
files used by it. With that you should be able to switch completely between java installations (regardless of JDK, JRE, ...).