Skip to main content

Using deployJava.setInstallerType()

20 replies [Last post]
rogyeu
Offline
Joined: 2006-07-30
Points: 0

Original post:
http://forums.java.net/jive/thread.jspa?messageID=317457

> > Java Deployment Toolkit Plug-In is different from
> the
> > Java Plug-In. The DT plugin is part of the Java
> > Deployment Toolkit. It installs with the Java
> > platform (JRE). No extra download is required.
> >
>
> Ok...
>
> Question -- can I use:
>
> deployJava.setInstallerType('kernel');
> // include any required packages as shown below
> deployJava.setAdditionalPackages('javax.swing,
> javax.xml');
>
> Without using javascript to run my applet? Can I use
> a plain old applet
> tag with deployJava.setInstallerType("XXX") to
> download a JRE?
>
> And what types does setInstallerType take. There is
> still no documentation
> for deployJava.js even after all our requests.

deployJava.setInstallerType is a JavaScript function. You maybe able to call it with other langauge without JavaScript. However, the recommended usage is to call it with JavaScript and quote them with the tags. It does not work simply within the tags.

There are more than 1 way to deploy Java platform. If you do not want to use JavaScript at all, you can use your Applet tag and specify the min versions of JRE to run your applet. Now that 6u10 is also available on java.com, you can specify 6u10 as the min version for your applets if necessary. However, without using the deployJava object, your users will be installing Java with the online installer as this is the default installer on java.com at this time. Also, you won't be able to specify the package firstly to be downloaded when kernel installer is available. On the other hand, kernel installer has the mechanism to find out the necessary packages for your application and download them first. Therefore, specify packages should not be a major issue. Therefore, we still recommend deployJava whenever is possible.

setInstallerType takes either "online" or "kernel".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mbien
Offline
Joined: 2007-04-29
Points: 0

> Build the updating mechanism directly into the JVM.
> Let the JVM hotpatch itself
> hen it detects the need to upgrade. Browsers do it.
> Adobe products do it. Why
> an't Java? Leave me out of it. Why should I have to
> deploy deployJava.js so that
> SUN can upgrade it's product?

the JRE has already an autoupdater on windows. It is a background process called jusched.exe. I never saw it in action since I use most of the time dev releases anyway (and boot windows only for tests).

I don't think it has been already triggered for u10, I have the feeling SUN will wait a few weeks until JavaFX desktop is out and use the updater as vehicle to distribute JFX (maybe even with u11...).

demonduck
Offline
Joined: 2008-03-14
Points: 0

I know about the auto updater. I always turn it off. And I make sure that
that it is removed from the scheduler.

That's not what I'm suggesting.

I'm suggesting that each time the JVM starts, it phones home -- if possible --
to check if an update is needed. If it is needed, it downloads the update
and hotpatches itself -- maybe restarting if necessary. This
could all be done in native code before the JVM is actually loaded.

There has to be a small runtime for the JVM that loads it -- put the update
feature in the runtime code. It could all be done silently and quietly without
the user ever noticing it. That's what we all want isn't it?

I mean, the deployJava.js is a very fragile thing. Even cowwoc knows that
some people turn off JavaScript :-) So if the updating depends on the right
browser, the right deployment plugins, JavaScript and the correct usage
in an HTML page -- that's a real kludge and it's not going to be very
reliable.

cowwoc
Offline
Joined: 2003-08-24
Points: 0

> There has to be a small runtime for the JVM that
> loads it -- put the update
> feature in the runtime code. It could all be done
> silently and quietly without
> the user ever noticing it. That's what we all want
> isn't it?

Look what happened when I suggested the same thing myself a few months ago: http://discuss.joelonsoftware.com/default.asp?design.4.652999.25

I don't think those people like me anymore :)

demonduck
Offline
Joined: 2008-03-14
Points: 0

There is a fondness for the creation of strawmen arguments.

What if happens? Then all the demons in Hell will fly free etc.

Forceful and persuasive arguments are made about situations that have
never yet existed based on imagined catastrophe.

If SUN had done this early on, there would be no controversy. It just would just
be the way of things.

WRT: not being liked for my ideas -- I've been there...

The suggestion on the table to use deployJava.js is really fragile yet no one
seems to get upset about it. It just boggles me mind....

cowwoc
Offline
Joined: 2003-08-24
Points: 0

> The suggestion on the table to use deployJava.js is
> really fragile yet no one
> seems to get upset about it. It just boggles me
> mind....

What is so fragile about it? I'm only aware of two issues:

1) Some people turn off Javascript, but I suspect this to be the vast minority. Those same people likely turn off Java and Flash so they're not really our target audience anyway.

2) deployJava requires more work if you're trying to get pre-update10 users to upgrade to a newer JRE. Okay, so here there is room for improvement but still... a year from now when all new computers ship with post-update10 this problem will seamlessly disappear. Let's be more specific though: what extra work is involved when using the deployment toolkit with pre-update10 users? Can we bundle this work under the hood of deployJava.js so it's taken care of automatically for developers?

rogyeu
Offline
Joined: 2006-07-30
Points: 0

> But the Java Deployment Toolkit doesn't work
> [b]UNLESS [/b]you have 6u10 or newer so
> how can the user be forced to upgrade to plugin2
> using deployJava.js because it won't work
> unless plugin2 [b]AND [/b]the deployment toolkit
> plugins are already installed.
>
> What am I missing????

You don't need 6u10, "plugin2", or "deployment toolkit plugins" to get Java Deployment Toolkit to work.

>
> And I don't like the idea that my applet forces
> someone who I don't know, with a system
> that I don't know anything about to upgrade to the
> latest JRE. For all I know, upgrading
> to the latest JRE will screw up the users system.

That should not be the case. If that is the case, we wouldn't release and turn on Auto-Update. The magnitudes of JRE downloads are millions per month.
>
> And if I have a JNLP-applet -- it won't work unless
> plugin2 is already installed. So I first
> have to run a non-JNLP-applet first and then force
> the user to upgrade to plugin2 and
> then run my JNLP-applet.

That's one way of doing it. However, you may also use JavaScript to generate dynamic contents based on the getJREs() results. If it returns nothing or without update release info, you know that machine does not have 6u10 or later installed. Thus, you can either suggest users to upgrade or show them an Applet without using 6u10 features.
>
> This is really presumptuous that SUN would demand
> that people have to reconfigure their
> systems. That might be an ok idea for a tightly
> controlled LAN installation where
> the system administrator can do this sort of thing
> overnight and the user base
> won't even know the difference but on the World Wide
> Web, it's going to turn even
> more people away from Java.
>
> I don't like it when some application or website
> demands that I have to upgrade.
> I even turn off the Java upgrades and my browser
> upgrades and I'm a Java programmer.

My personal experience is I upgrade my Acrobat Reader every once awhile, and I lose track of which version I'm running already. IMHO, users are willing to upgrade if they want your content. If you can deliver the content and the user experience they are looking for, they wouldn't mind upgrading. That applies to people who buys need computer because they want it faster. I think your websites (http://pancyl.com) is a very good sample. In 6u10, you can pass the -XMx and -XMs VM arguments thus your users don't have to make the global manual change. To me, this is a good point to upgrade if I don't have the latest version of Java already.

I can see that Java programmers want to stay on a certain release to develop and test their applications, but that is for the sake of stability during the development cycle to reduce any possible error factors. There are no rules that prohibit applications work on other platforms or environments the spec doesn't include. ;-)

>
> Maybe what I would like to see is a way for an
> ordinary
> applet to detect which JRE was installed and suggest
>
> gently to the user that a newer version is
> available.
>
> This idea just came to my mind. I think I can do
> this
> with System.properties() or whatever those methods
> are.
Yes, this can be done easily by reading the System.getProperty("java.version"). If the returned version is not what you want, then call
Desktop.getDesktop() and Desktop.browse(uri)
or
getAppletContext.showDocument(url)
that points user to http://java.com.

BUT that will not work for users without Java. Therefore, may I suggest: deployJava.getJREs() and installLatestJRE if you 1.6.0_10 is not returned?

>
> Maybe a simple enhancement would be a couple of
> methods
> that could be called by an applet to test and inform
> the user that an upgrade is available. Maybe a
> simple
> API like that would be a nice thing to add to 1.7.
Deployment Toolkit covers people with or without Java installed. I would recommend using DT instead of Java API unless I'm missing something here.

demonduck
Offline
Joined: 2008-03-14
Points: 0

> Deployment Toolkit covers people with or without Java
> installed. I would recommend using DT instead of Java
> API unless I'm missing something here.

I don't know about all browsers but FF will display a plugin missing
icon if there is no Java installed. That's actually the best of all possible
worlds since it is a fresh install of the latest Java without any complicated
code in the HTML page.

rogyeu
Offline
Joined: 2006-07-30
Points: 0

Good that the current behavior works for you.

tdanecito
Offline
Joined: 2005-10-10
Points: 0

I have tested jre install using deployJava.js and it works just fine except for using ie 7 to upgrade to 6u10.
Also, I have noticed very few users on 6u10 yet because of the auto update or jusched that runs on the desktop and shown in the taskbar does not update to 6u10 as mentioned in this thread.

Hopefully 6u11 with JavaFX comes out very soon so users are switched to the newer java version. My rich client uses 1.6.X so I do not need 6u10 but would be good for Sun to release it for java client side apps that are widely used such as MyUniPortal.

Regards,

-Tony Anecito
Founder,
MyUniPortal

rogyeu
Offline
Joined: 2006-07-30
Points: 0

Hi Tony,

Could you please submit a bug report about the problem of upgrading 6u10 w/ IE7? You may post the incident number, and I'll post back the bug ID after I have confirmed the issue.

The reason that I need a bug report is that the bug submission page asks many information that are necessary than people usually just describe it in a post.

http://bugreport.sun.com/

Thanks,
Roger Y.

Message was edited by: rogyeu

tdanecito
Offline
Joined: 2005-10-10
Points: 0

Hi Rogyeu,

Sure I will add to the bug list once I can reproduce it again. I did see a problem again last night and not sure why. Seems update is trying to install activex or some sort of plugin and was blocked by IE. Instructions from IE 7 were way wrong on how to unblock so I never did get addons enabled.

Is it activex or a addon that is being needed for deployJava.js for IE 7?

Thanks,
-Tony

rogyeu
Offline
Joined: 2006-07-30
Points: 0

>Seems update is trying to install
> activex or some sort of plugin and was blocked by IE.
> Instructions from IE 7 were way wrong on how to
> unblock so I never did get addons enabled.
can you please provide a screenshot?
>
> Is it activex or a addon that is being needed for
> deployJava.js for IE 7?
The Java Web Start activeX object is used in IE to return the Java major version. The Java Deployment Toolkit Plug-In is used to return the update release info.

demonduck
Offline
Joined: 2008-03-14
Points: 0

> > Question -- can I use:
> >
> > deployJava.setInstallerType('kernel');
> > // include any required packages as shown below
> > deployJava.setAdditionalPackages('javax.swing,
> > javax.xml');
> >
> > Without using javascript to run my applet? Can I
> use
> > a plain old applet
> > tag with deployJava.setInstallerType("XXX") to
> > download a JRE?
> >
> > And what types does setInstallerType take. There
> is
> > still no documentation
> > for deployJava.js even after all our requests.
>
> deployJava.setInstallerType is a JavaScript function.
> You maybe able to call it with other langauge without
> JavaScript. However, the recommended usage is to call
> it with JavaScript and quote them with the