sexta-feira, 24 de junho de 2011

Chrome bug with Java Deployment Toolkit Script

When trying to install a Java plugin for the Chrome browser, it redirects to the Java Download Page. And though you can see you have the required Java version by testing it thru the Java version verification page, it keeps redirecting to the Java Download Page.

It happened to me when I tried to install a Brazilian bank website's security module in Chrome version 12.0.742.100.

The problem occurs when the getJREs() method of the Java Deployment Toolkit Script is called. The script is available at http://java.com/js/deployJava.js. The problem is that If you have more than one JRE installed on your Windows OS (mine is XP), instead of giving all your versions, it gives just one of your versions (repeated by the number of versions you got indeed).

At least in my pc, which has 2 versions, 1.4.1_02 and 1.6.0_26, getJREs() returns an array with 2 strings, but both are “1.4.1_02”. Both JREs are installed under C:\Program Files\Java (in fact my path is “C:\Arquivos de programas\Java” since it’s the Portuguese translation). Their folder names are “j2re1.4.1_02” and “jre”, respectively. My JAVA_HOME environment variable points to the newer version.
Internet Explorer 8 and Firefox 4.0.1 returns correctly both versions “1.4.1_02” and “1.6.0_26” strings.

I don't know if this bug has already been documented. In fact I’m not totally sure it’s a Chrome bug, but it seems to be, since IE and Firefox work fine with it.

All I could find is that the bug is related to the object embedded by a <embed hidden="true" id="deployJavaPlugin" type="application/java-deployment-toolkit"></embed> tag which is added to the HTML document by the script code, to be retrieved later with document.getElementById for its specific usage.

Test
You can test it with my getJREs Test page.

Quick Solution for Chrome Users
You probably don’t need the older versions of Java. In fact according to Java website they "highly recommend users remove all older versions of Java from your system." (read more here). So just delete them, or follow these instructions.

Nenhum comentário:

Postar um comentário