Java Deployment Toolkit - 6u10

Java Deployment Toolkit, yes again I am talking of 6u10. It deploy applets and applications to a large variety of clients with JS. I have written some one liner which has some great capability to do:

<HTML>
<BODY>
<script src="http://java.com/js/deployJava.js">
deployJava.installLatestJRE();
</script>
</BODY>
</HTML> 

It looks small code but it can install the latest JRE on your machine. Just copy paste the code in a HTML page and run it. And here is the second one:

<HTML>
<BODY>
<script src="http://java.com/js/deployJava.js"></script>
<script>
    var list = deployJava.getJREs();
        var result = "";
           result = list[0];
        for (var i=1; i<list.length; i++) {
                result += ", " + list[i];
        }
            alert("You have the following Java Platform(s) installed: \\n" + result);
</script>
</BODY>
</HTML> 

This code will tell you the installed JRE's on your machine.  In all this game, the important thing is deployJava.js which has lot of other cool method. Check the link in the code for details :-). We just need to use those functions for our need. There are some better example is on sun site.


Comments:

Hi Vaibhav,

I have used above script to find out java version but in firefox 3+ It was not working it becomes hang. According to me, deployJava.js is not generalize solution to install java or check java version using javascript.

If you have any other script to find out java version and install java please let me know.

I know you luv firefox 3. I also luv firefox. We need to find some solution to resolve this bug.

:-)

Thank you
Madhav vyas

Posted by Madhav vyas on June 16, 2009 at 01:19 PM IST #

If it is so, then its a bug and Sun has to fix it. Because this is a std. solution provided by Sun and even client has been guided with the same rule.

Posted by Vaibhav on June 16, 2009 at 01:26 PM IST #

I worked on an application running in an applet and I played with JS, different browsers and different Java versions installed on them a while ago. I looked at this Sun's script and I still find it possibly unreliable.
The best solution I was able to find was
1) using a double 'object classid=' etc. html tag to define an applet on a page
2) Displaying a link for http://www.java.com/en/download/ if browser has no Java plugin installed (definition inside the tag)
3) Running a small applet testing required Java version from within jvm running on that browser, redirecting to a page with applet application if version is okay, or displaying something like 'java version too old, click to get a newest one' message. after clicking which you are redirected to http://www.java.com/en/download/

The java.com webpage detects what browser you are using and within a few clicks you are able to install the latest java plugin for your browser. If it is available, which is not always the case, but this is by my opinion, the best you can do

Posted by Marian on July 09, 2009 at 10:29 AM IST #

i wish to know if there is a way to modify deployJava to make it work in an intranet
thanks

Posted by hakim on December 12, 2009 at 05:30 PM IST #

Post a Comment:
Comments are closed for this entry.
About

Hi, I am Vaibhav Choudhary working in Sun. This blog is all about simple concept of Java and JavaFX.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today