#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    78
    Rep Power
    11

    How to display Java version?


    Working on a system checker here.

    http://www.chadwickcmeyer.com/checker

    I want to display the version of Java that is installed. what command do I use to check for the different java versions? I am only concerned with checking for Java in IE.

    Thanks!
  2. #2
  3. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,540
    Rep Power
    1621

    Script to detect java version.


    I got this from a Google Group:

    http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/8a36d2b599ac6550/e548e152c6608ca0%23e548e152c6608ca0?sa=X&oi=groupsr&start=0&num=3

    Here's the script:

    PHP Code:
    <script
    function 
    getComVer(i){ 
     var 
    V=new Array(); 
     
    // List classID's for all component queries needed ... 
     
    V[0]='08B0E5C0-4FCB-11CF-AAA5-00401C608500';// msjava.dll 
     
    V[1]='22D6F312-B0F6-11D0-94AB-0080C74C7E95';// 
     
    return(Components.getComponentVersion('{'+V[i]+'}','componentid'))} 


    function 
    Itemize(){ 
     var 
    iS='Full Versions of Installed Components...\n'
     
    A='msjava.dll,Windows Media Player,Flash'.split(','); 
     for(
    i=0i<A.lengthi++) S+='\n'+A[i]+': '+getComVer(i); 
     return 
    S


    alert(Itemize()) 


    </script> 
    When the programming world turns decent, the real world will turn upside down.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    78
    Rep Power
    11
    thanks for the info...

    any methods that dont require php? the code has to be in javascript
  6. #4
  7. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,935
    Rep Power
    4033
    That is javascript, just happens to be within php highlighting tags. PHP wouldn't even be capable of this.
    Recycle your old CD's, don't just trash them



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    78
    Rep Power
    11
    Originally Posted by kicken
    That is javascript, just happens to be within php highlighting tags. PHP wouldn't even be capable of this.
    Thanks for the info I'll have to try it out!
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    78
    Rep Power
    11
    Cant get the code to work.

    Here is the webpage where I am doing the check.

    http://www.chadwickcmeyer.com/checker/

    You can view the source to see what I am doing. The code still needs to be cleaned up and better formatted. I still cant find a way to call the code to get everything to work.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2003
    Posts
    72
    Rep Power
    11
    try out this code:

    Code:
    typeof(navigator.javaEnabled)
    but check if java is ennabled in the first place other wise it might return an UNKOWN

    good luck...

IMN logo majestic logo threadwatch logo seochat tools logo