In my laptop, I have openjdk1.6, openjdk-1.7, and openjdk1.8 installed. I can see all of them through update-alternative --config java
.
$update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 auto mode
1 /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java 1061 manual mode
2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode
3 /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java 1081 manual mode
I also have openjdk-7-plugin
installed. But I don't know why my firefox always shows that my latest java version is
application/x-java-bean;jpi-version=1.7.0_50
I already tried to Re-initializing the plugins database, but it doesn't work. How can I see my latest java in the browser plugin? I can see my newest java version through the oracle java version verify page.
update:
I installed the icedtea-8-plugin
then removed the icedtea-7-plugin
. However, the about:plugins shows that my java version is application/x-java-bean;jpi-version=1.6.0_50
. The plugin path is correctly pointed to
Path: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
The oracle java version verify page can correctly show my java version is 1.8.0_45-internal
. Does anyone have idea on how firefox discovery the java version on my laptop?
Update2:
Thanks @TrevorL for you detailed answer.
Now I removed all the openjdk-*
packages in my system. The only thing I install is openjdk-8-jre
and icedtea-8-plugin
.
I confirmed all the executable and configs are located in /usr/lib/jvm/java-8-openjdk-amd64/
. The mozilla-plugins.so
points to /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
. The itweb-settings
is also pointed to correct version.
I do see firefox using the correct IcedTeaPlugin.so in the about:plugins
. Since I only have 1 version jvm installed in my system now. I think the question should be modify to: why IcedTeaPlugin.so in icedtea-8-plugin report java 1.6.0_50 in Firefox?
Best Answer
UPDATE2:
On startup, Firefox references the java plugin file located in
/usr/lib/mozilla/plugins
, this file could be namedlibjavaplugin.so
ormozilla-javaplugin.so
Currently, the IcedTea install from Ubuntu Software Center is IcedTea-plugin7 then its configuration results in the incorrect JVM version reported by FireFox
about:plugins
and from the Oracle browser test - despite a prior OpenJDK8 installation . A possible explanation is the way IcedTea configures itself by creating directories in/usr/lib/jvm
with names prefixed byjava-<version>-openjdk<bits>
even if these JVMs are not installed on the machine.symLinks are then created to these folders for the installed jdk and a default jdk1.7 - in the case that openjdk8 was installed.
The symlink
itweb-settings
is configured to reference alternatives for a configuration file created in each JVM copy folder/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/itweb-settings
/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/itweb-settings
and an executable
IcedTeaPlugin.so
at location/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64
referenced by linkmozilla-javaplugin.so
However, the IcedTea-plugin7 does not place a configuration or executable within the copy folder of
java-8-openjdk-amd64/jre/
which could explain the selection of the default / higher priority jdk7 as defined by the symlinkmozilla-javaplugin.so
.Since, you have already installed IcedTea-plugin8 you need to confirm the configuration then attempt to select the different JVMs as you required.
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64
and
confirm the value of symlink
itweb-settings
to the correct configuration file per JVMsudo update-alternatives --display itweb-settings
if this works for jdk8 then update-alternatives for each JVM
sudo update-alternatives --install mozilla-plugins.so <IcedTeaPlugin.so per JVM>
sudo update-alternatives --install itweb-settings <itweb-settings per JVM>
then configure itweb-settings as you require to use each JVM
sudo update-alternatives --configure itweb-settings
****** UPDATE3 ******
itweb-settings
configuration file references; two possible paths from the HOME directory for thedeployment.properties
~/.config/icedtea-web/deployment.properties
~/.icedtea/deployment.properties
and a global path
/etc/.java/.deploy/deployment.properties
Maybe one of these files is referencing openJdk6 ?
****** UPDATE4 ******
The plugin relies on symlink priority, so ensure that jdk8 has the highest priority then
update-alternatives
toauto mode
.And ensure that the symlink for
javaws
is defineduninstall then re-install the v8 plugin