1

I am stuck: how to check if a user has a specified java requirement? I need to find ranges (for instance java versions between 1.5.0_10 and 1.6.0_10). I am using javaDeploy.js from Oracle and using the versioncheck method but I can't figure what I need to pass inside the versionCheck method for ranges such as the example I provided.

4

2 回答 2

5

尝试这个:

var lower = deployJava.versionCheck("1.5.0_10+"),
    higher = deployJava.versionCheck("1.6.0_10+")
if (lower && !higher) {
    // between 1.5.0_10 && 1.6.0_10
}

参考:

于 2013-05-09T20:22:44.347 回答
0

你也可以直接获取java版本:

<script src="http://www.java.com/js/deployJava.js"></script>
<script>
     var versions = deployJava.getJREs();
     alert(versions);
     if(versions>= "1.5.0" && versions<= "1.6.1")
     alert("correct version");   
</script>
于 2013-05-09T20:38:34.533 回答