Solved

Programmatically check if java is enabled in a browser

Posted on 2013-11-21
11
551 Views
Last Modified: 2013-11-25
Hi Experts,

How can I test if java is enabled in the browser (without the user getting prompted to install it if it isn't)?

Thanks,
Mike
0
Comment
Question by:thready
  • 4
  • 4
  • 3
11 Comments
 
LVL 1

Author Comment

by:thready
ID: 39665941
I have found these ones which look good, but just in case someone finds other good ones to recommend (preferably free of course)

free:
http://www.pinlady.net/PluginDetect/Java/

paying:
http://www.cyscape.com/products/bhawk/workshop/detectjava.aspx?bhcp=1

using deployJava.getJREs() (doesn't show if enabled if java disabled from control panel)
http://download.oracle.com/javase/6/docs/technotes/guides/jweb/deployment_advice.html

I also saw the following EE question:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/HTML/Q_20933992.html
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 500 total points
ID: 39666357
You don't need any plugin it is a single line of javascript to look at the navigator object.

Jenabled = navigator.javaEnabled();

it returns tru or false.

Cd&
0
 
LVL 9

Expert Comment

by:Sar1973
ID: 39668457
Use navigator.javaEnabled() (will return a boolean true/false answer).
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39669398
@Sar1973,

Great response ... about 6 hours late.  If you don't have an optional solution then stay out of the thread instead of copying what has already been posted.

COBOLdinosaur, Topic Advisor
0
 
LVL 9

Expert Comment

by:Sar1973
ID: 39671636
@COBOL: I sometime do not read the previous answers; the function I have posted is so common that I do not need to copy it from you (with respect talking).
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 1

Author Comment

by:thready
ID: 39671642
When I google navigator.javaEnabled(), I get a bit of mixed feelings on it- there seems to be issues with it on certain browsers.  When I look at the support for it on W3C schools, it clearly looks well supported, yet when I look at sites like this: http://www.pinlady.net/PluginDetect/Java/, it makes me think that there clearly must be issues with it.  Are my concerns valid?

Thanks,
Mike
0
 
LVL 9

Expert Comment

by:Sar1973
ID: 39671645
Some browsers/versions have already it installed by default, others like IE8 do not. That's why you may spot differences in using the code.
You can add an additional test (navigator.userAgent) that checks which browser you are using to test this.
0
 
LVL 1

Author Comment

by:thready
ID: 39671773
Any comment on why the up-to-date code found here  http://www.pinlady.net/PluginDetect/Java/ that does this, is so extensive?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39672022
http://www.pinlady.net/ is hardly what I would call an authoritative site.

However both MDN and MSDN which are authoritative do not obfuscate and bloat with anything more complex than the simple one line syntax.  Both point out that this is not part of the DOM standard so browsers are not required to include it.  However ALL modern browsers do support it, and unless your site stats indicate that you are getting a lot of traffic from some kind of non-standard fringe browser you are probably just wasting your energy worrying about a non-issue.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39672028
BTW all the junk on pinlady is java methods doing all kinds of detection of version and features and has absolutely nothing to do with determining if java isenabled.

Cd&
0
 
LVL 1

Author Closing Comment

by:thready
ID: 39675270
Thank you!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now