469,327 Members | 1,226 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,327 developers. It's quick & easy.

Determen Java evalibility and version.

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
4 1827
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
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


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

Similar topics

73 posts views Thread by RobertMaas | last post: by
2 posts views Thread by Dave Brueck | last post: by
reply views Thread by Markus Wollny | last post: by
5 posts views Thread by Hassan Naqvi | last post: by
4 posts views Thread by aotemp | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.