• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Detecting if a JVM is present, using Javascript?

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

Well, I've seen things similar to what was mentioned in this thread, but it doesn't work everywhere.

I need to figure out a way, ideally using Javascript, of detecting in a browser whether or not there is a JVM available.

The page mentioned in the thread I linked to above only seems to work on Mozilla-based browsers, but not IE6 or Opera.

I need this to work on IE6 (Win), Safari 2.0 (MacOS), and Firefox/Mozilla (Linux, Solaris, Win, Mac). Optionally, I'd like it to work with Opera as well, but I'm not required to do so.

I've tried using navigator.javaEnabled(), but that seems to behave inconsistently. On some PCs (such as mine, a WinXP SP2 machine), it actually will return true or false based on whether or not there is a JRE present. On my colleage's machine, also WinXP SP2, as well as on my Linux machine, it only returns whether or not the Enable Java box is checked in the browser's preferences. Strangely, this occurs regardless of which browser we use, just whether or not it's on my PC or not, it seems.

So what can I do that will be reliable and work on more or less everything? Once I know that a JRE is present and available to web pages, I can then use my applet to determine what JVM version is running.

If I have to do conditionals based on what browser I'm running, so be it - but it has to work on all 3 that we officially support (Mozilla-based, IE6, and Safari 2.0)

Thanks in advance....
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
https://coderanch.com/t/256248/Applets/java/detect-JVM-plugin-version

Eric
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually, I have the part (an applet) that will detect the version - what I need is some Javascript that will *reliably* let me know if there is no Java Plugin or JRE available to the browser at all - in which case I'd post an alert message to the user.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic