5 Replies - 537 Views - Last Post: 09 May 2013 - 12:59 PM

#1 polska03  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

find java versions

Posted 09 May 2013 - 12:29 PM

 
if (deployJava.versionCheck("1.6.0+") || deployJava.versionCheck("1.4") || deployJava.versionCheck("1.5.0*")) 
    {
        alert("Java is Enabled");
    } else 
    {
        alert("Java is Not Enabled");
    }'


I had a question regarding this code. This code uses deployJava.js (http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html) from Oracle. My question is how exactly the + and * work. I assume the + means anything greater, but what does the * mean? My objective is to get version numbers like for example java versions 1.5.0_02 or higher, or 1.5.0_02 to 1.6.0_20

This post has been edited by polska03: 09 May 2013 - 12:37 PM


Is This A Good Question/Topic? 0
  • +

Replies To: find java versions

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9393
  • View blog
  • Posts: 35,273
  • Joined: 12-June 08

Re: find java versions

Posted 09 May 2013 - 12:36 PM

The * is a wild card for the java family version.

http://www.oracle.co...sid-140615.html
Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3623
  • View blog
  • Posts: 12,511
  • Joined: 12-December 12

Re: find java versions

Posted 09 May 2013 - 12:41 PM

Quote

versionPattern String specifying the version or range of versions to check for, such as such as "1.4", "1.5.0*" (1.5.x family), and "1.6.0_02+" (any version greater than or equal to 1.6.0_02).

Was This Post Helpful? 1
  • +
  • -

#4 polska03  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

Re: find java versions

Posted 09 May 2013 - 12:51 PM

thanks for the reply! That makes sense, do you know how though I could find ranges of java versions from v1 to v2?

sorry I just posted and then saw your post!

Would it be possible to get an example of a range?

nevermind i got it versioncheck("1.4", "1.5.0*")
Was This Post Helpful? 0
  • +
  • -

#5 andrewsw  Icon User is online

  • It's just been revoked!
  • member icon

Reputation: 3623
  • View blog
  • Posts: 12,511
  • Joined: 12-December 12

Re: find java versions

Posted 09 May 2013 - 12:55 PM

I do not know whether you could specify a range. I suspect that you need to use a combination (using or ||, as you are doing) to cover the versions that you are interested in.

I would guess that all versions 1 are "1.0*".

View Postpolska03, on 09 May 2013 - 07:51 PM, said:

Would it be possible to get an example of a range?

nevermind i got it versioncheck("1.4", "1.5.0*")

Well done. I assume that is inclusive, then, of all the version in-between?
Was This Post Helpful? 0
  • +
  • -

#6 polska03  Icon User is offline

  • D.I.C Regular

Reputation: 5
  • View blog
  • Posts: 302
  • Joined: 28-November 09

Re: find java versions

Posted 09 May 2013 - 12:59 PM

never mind my solution does not work, I am running java 6 and tried versioncheck("1.4.0","1.7.0" and it returned false
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1