Detect Java enabled browser

R

Ryan Stewart

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

SPG

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 );
}
}
 
R

Ryan Stewart

*fixed top post*
SPG said:
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.
 
B

ByteCoder

Ryan said:
*fixed top post*


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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top