deployJava脚本在Chrome浏览器中失败

时间:2021-11-14 21:16:36

I am trying to use the deployJava script from Oracle to check the installed java version. It works fine on FireFox but fails in Chrome, as when i test java version 1.6 it always returns false which means i have a java version below 1.6, which is not right. I've seen some forums mentioning this problem, but i have found no fix for this until now.

我正在尝试使用Oracle的deployJava脚本来检查已安装的Java版本。它在FireFox上工作正常,但在Chrome中失败,因为当我测试java版本1.6时,它总是返回false,这意味着我有一个低于1.6的java版本,这是不对的。我看过一些论坛提到这个问题,但直到现在我还没有找到解决方法。

Anyone has checked this script before ?

有人之前检查过这个剧本吗?

---------------------------------------------------> Edit - Add a code sample :

-------------------------------------------------- - >编辑 - 添加代码示例:

var isJavaValid = deployJava.versionCheck( '1.6.0+' );

if( isJavaValid == false ) {
   alert( "Java required version is not found" );  // Always appears.
}
else {
   alert( "You have the right java version." );
}

1 个解决方案

#1


0  

This works for me:

这对我有用:

<html>
<head>
<script type="text/javascript" src="http://java.com/js/deployJava.js"></script>
<script type="text/javascript">
function init()
{
var isJavaValid = deployJava.versionCheck( "1.6.0+" );

if( isJavaValid == false ) {
   alert( "Java required version is not found" );  // Always appears.
}
else {
   alert( "You have the right java version." );
}
}
</script>
</head>
<body onload="init()">
</body>
</html>

Test here: http://jsbin.com/ikiza4

在这里测试:http://jsbin.com/ikiza4

#1


0  

This works for me:

这对我有用:

<html>
<head>
<script type="text/javascript" src="http://java.com/js/deployJava.js"></script>
<script type="text/javascript">
function init()
{
var isJavaValid = deployJava.versionCheck( "1.6.0+" );

if( isJavaValid == false ) {
   alert( "Java required version is not found" );  // Always appears.
}
else {
   alert( "You have the right java version." );
}
}
</script>
</head>
<body onload="init()">
</body>
</html>

Test here: http://jsbin.com/ikiza4

在这里测试:http://jsbin.com/ikiza4