Detect Java enabled browser

Discussion in 'Java' started by Ryan Stewart, Dec 24, 2004.

  1. Ryan Stewart

    Ryan Stewart Guest

    I'm working on a project to collect usage statistics, and I'm looking for a
    way to detect whether a browser has a Java plugin. I'll be writing it in
    Java, and am quite familiar with J2EE, or at least the servlet corner of it.
    Ideally, I'd like something I can JAR up and drop in an application and have
    it collect data. Obviously I can't quite get away with that, but that's the
    direction I'm going with it. So... anyone have experience with this? Can I
    get Java version and such?
    Ryan Stewart, Dec 24, 2004
    #1
    1. Advertising

  2. Ryan Stewart

    SPG Guest

    This will do what you want..
    Obviously, once you have the VM properties, you can do with them as you
    please.. Like post them back to a servlet or external service etc..

    Steve

    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;

    public class VMDetect
    extends Applet {

    //Construct the applet
    public VMDetect() {
    }

    //Initialize the applet
    public void init() {
    String vmName = System.getProperty("java.vm.name");
    String vVendor = System.getProperty("java.vm.vendor");
    String vmVersion = System.getProperty("java.vm.version");
    System.out.println("Name: " + vmName );
    System.out.println("Vendor: " + vVendor );
    System.out.println("Version: " + vmVersion );
    }
    }



    "Ryan Stewart" <> wrote in message
    news:...
    > I'm working on a project to collect usage statistics, and I'm looking for
    > a way to detect whether a browser has a Java plugin. I'll be writing it in
    > Java, and am quite familiar with J2EE, or at least the servlet corner of
    > it. Ideally, I'd like something I can JAR up and drop in an application
    > and have it collect data. Obviously I can't quite get away with that, but
    > that's the direction I'm going with it. So... anyone have experience with
    > this? Can I get Java version and such?
    >
    SPG, Dec 24, 2004
    #2
    1. Advertising

  3. Ryan Stewart

    Ryan Stewart Guest

    *fixed top post*
    "SPG" <> wrote in message
    news:sH%yd.6587$...
    > "Ryan Stewart" <> wrote in message
    > news:...
    >> I'm working on a project to collect usage statistics, and I'm looking for
    >> a way to detect whether a browser has a Java plugin. I'll be writing it
    >> in Java, and am quite familiar with J2EE, or at least the servlet corner
    >> of it. Ideally, I'd like something I can JAR up and drop in an
    >> application and have it collect data. Obviously I can't quite get away
    >> with that, but that's the direction I'm going with it. So... anyone have
    >> experience with this? Can I get Java version and such?
    >>

    > This will do what you want..
    > Obviously, once you have the VM properties, you can do with them as you
    > please.. Like post them back to a servlet or external service etc..
    >

    *snip applet*

    That would work, I suppose, but I'm hoping to find something less intrusive.
    Ryan Stewart, Dec 24, 2004
    #3
  4. Ryan Stewart

    ByteCoder Guest

    Ryan Stewart wrote:
    > *fixed top post*
    > "SPG" <> wrote in message
    > news:sH%yd.6587$...
    >
    >>"Ryan Stewart" <> wrote in message
    >>news:...
    >>
    >>>I'm working on a project to collect usage statistics, and I'm looking for
    >>>a way to detect whether a browser has a Java plugin. I'll be writing it
    >>>in Java, and am quite familiar with J2EE, or at least the servlet corner
    >>>of it. Ideally, I'd like something I can JAR up and drop in an
    >>>application and have it collect data. Obviously I can't quite get away
    >>>with that, but that's the direction I'm going with it. So... anyone have
    >>>experience with this? Can I get Java version and such?
    >>>

    >>
    >>This will do what you want..
    >>Obviously, once you have the VM properties, you can do with them as you
    >>please.. Like post them back to a servlet or external service etc..
    >>

    >
    > *snip applet*
    >
    > That would work, I suppose, but I'm hoping to find something less intrusive.


    Why would that be intrusive? If the applet can't get those properties
    due to security restrictions there's no harm done. I can't think of any
    other way to do this.

    --
    -------------
    - ByteCoder - ...I see stupid people
    -------------
    Curiosity *Skilled* the cat
    ByteCoder, Dec 25, 2004
    #4
  5. On Sat, 25 Dec 2004 01:32:54 +0100, ByteCoder wrote:

    > Ryan Stewart wrote:


    >> *snip applet*
    >>
    >> That would work, I suppose, but I'm hoping to find something less intrusive.

    >
    > Why would that be intrusive? If the applet can't get those properties
    > due to security restrictions there's no harm done. I can't think of any
    > other way to do this.


    To check what you can and can't find out from an unsigned Applet,
    check JTest. <http://www.physci.org/pc/property.jsp>

    --
    Andrew Thompson
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.PhySci.org/ Open-source software suite
    http://www.1point1C.org/ Science & Technology
    http://www.LensEscapes.com/ Images that escape the mundane
    Andrew Thompson, Dec 25, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gabor
    Replies:
    3
    Views:
    612
    Jacob Yang [MSFT]
    Aug 26, 2003
  2. NWx

    Detect if cookies are enabled

    NWx, Feb 16, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    12,592
    Eric Lawrence [MSFT]
    Feb 18, 2004
  3. oreng
    Replies:
    1
    Views:
    6,658
    Tamir Khason
    Jul 7, 2004
  4. Tee
    Replies:
    2
    Views:
    475
    Ben Lucas
    Dec 1, 2004
  5. Anees
    Replies:
    10
    Views:
    436
    Anees
    Jan 11, 2008
Loading...

Share This Page