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.

1

2 Answers 2

5

Try this:

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
}

Reference:

Sign up to request clarification or add additional context in comments.

1 Comment

You can also make use of deployJava.getJREs() to get the version directly.
0

You could also directly get the java version:

<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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.