By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,536 Members | 1,504 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,536 IT Pros & Developers. It's quick & easy.

Determen Java evalibility and version.

P: n/a
Hi.
can anyone help me with how to find if JAVA is evalible and if yes,
of what version?
Thanks
Dani
Jul 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Dani Shapira wrote:
Hi.
can anyone help me with how to find if JAVA is evalible and if yes, of
what version?


comp.lang.java is over there ============>

Java != Javascript

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2

P: n/a
Randy Webb wrote:
Dani Shapira wrote:
Hi.
can anyone help me with how to find if JAVA is evalible and if yes,
of what version?

comp.lang.java is over there ============>

Java != Javascript

I know that Java and Javascript is not the same!!!!
The quetion is: How can I, in JavaScript, find out if Java is avaliable
for this browser to run applet og later page.
Jul 23 '05 #3

P: n/a


Dani Shapira wrote:

Dani Shapira wrote:
can anyone help me with how to find if JAVA is evalible and if yes,
of what version?
The quetion is: How can I, in JavaScript, find out if Java is avaliable
for this browser to run applet og later page.


Most browsers should support
if (navigator.javaEnabled()) {
...
}
Testing the Java version is probably better done then in a Java applet
itself, only a few browsers (Mozilla, Opera) support LiveConnect
JavaScript->Java direct access e.g.
if (navigator.javaEnabled() && typeof java != 'undefined') {
alert(java.lang.System.getProperty('java.version') );
}

As long as browsers are using the Sun Java plugin you can also look into
the navigator.mimeTypes e.g.

var mimeType = navigator.mimeTypes ?
navigator.mimeTypes['application/x-java-applet'] : null;
if (mimeType) {
var plugin = mimeType.enabledPlugin;
if (plugin) {
alert(plugin.description);
}
}
for me here on Windows that shows
Java Plug-in 1.5.0_01 for Netscape Navigator (DLL Helper)
so you could try to extract the version from that string.

But IE/Win doesn't support navigator.mimeTypes for such stuff.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4

P: n/a
Dani Shapira wrote:
Randy Webb wrote:
Dani Shapira wrote:
Hi.
can anyone help me with how to find if JAVA is evalible and if yes,
of what version?


comp.lang.java is over there ============>

Java != Javascript

I know that Java and Javascript is not the same!!!!
The quetion is: How can I, in JavaScript, find out if Java is avaliable
for this browser to run applet og later page.


In short, you can't reliably. There are too many other factors that
affect it, as Martin pointed out. It also fails if scripting is disabled
or not present. And these very reasons are why I directed you to a Java
Newsgroup. The Java gurus are better prepared to tell you how, in Java,
determine what you are wanting to know.

comp.lang.java

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.