[WebStart] How can I change the location of the Web Start cache?

  • Thread starter Tarlika Elisabeth Schmitz
  • Start date
T

Tarlika Elisabeth Schmitz

Hello,

In case you're reading this, Andrew, I've got a new challenge for you:
(I heard on the grape-vine that you're a bit of a WebStart specialist ;-) )

Most of the WebStart docs I have found seem to refer to older versions
and therefore some of the tips I've seen don't work. I am running 1.4.2

The webstart cache is normally installed per user, not per system. On
Linux, the cache is located somewhere in $HOME/.java, and on Windoze
somewhere in the application folder.

I want to use WebStart for an Intranet application, more or less as a
convenience: rather than having to install every new release on X
machine, I'll just pop it on the local server.

1) I want to pre-install the cache and provide an icon to the
application (desktop integration). I guess, I'll just have to do this by
hand for the first installation. Or does anyone have a better idea?

2) I would like to choose a different location for the cache (per system
rather than per user).
Somewhere I saw the tip to change the following property:
javaws.cfg.cache.dir=c:/Programme/JavaSoft/JWSCache

I think there used to be a javaws.cfg file but there isn't any longer.
Where are all these settings stored now?

--


Regards/Gruß,

Tarlika Elisabeth Schmitz
 
A

Andrew Thompson

Hello,

In case you're reading this, Andrew, I've got a new challenge for you:
(I heard on the grape-vine ...

Whoever said that?
..that you're a bit of a WebStart specialist ;-) )

...Slap them for me!

I am a leading proponant of WebStart, and use it's simpler forms for
my own software suite, but in no way am I an expert/specialist on it*.
Most of the WebStart docs I have found seem to refer to older versions
and therefore some of the tips I've seen don't work. I am running 1.4.2

The webstart cache is normally installed per user, not per system. On
Linux, the cache is located somewhere in $HOME/.java, and on Windoze
somewhere in the application folder.

I want to use WebStart for an Intranet application, more or less as a
convenience: rather than having to install every new release on X
machine, I'll just pop it on the local server.

1) I want to pre-install the cache and provide an icon to the
application (desktop integration).

I do not quite follow. Do you mean as distinct to the shortcuts
that JWS creates for the application itself?
.. I guess, I'll just have to do this by
hand for the first installation. Or does anyone have a better idea?

2) I would like to choose a different location for the cache (per system
rather than per user).
Somewhere I saw the tip to change the following property:
javaws.cfg.cache.dir=c:/Programme/JavaSoft/JWSCache ...

Based on the 'JWSCache' string, on which the only reference
was the Sun forums, I found my way to this..
<http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html>

It looks hopeful for configuring the sorts of things of which
you are referring, but I am still working through this document,
and not much of what it says makes sense to me.

I can find none of the files they refer to on my WinXP box,
and none of the 'system properties' they mention appear in
the System.getProperties enumeration.
I think there used to be a javaws.cfg file but there isn't any longer.
Where are all these settings stored now?

...you might get some tips from that page I mentioned, I
will certainly be giving it a closer look.

[ This is of interest to me since I want to deploy Saverbeans
ScreenSavers to Win/*nix boxes using JWS, but they need to be
installed in specific directories. * But, to be honest, your
post has got me closer to that goal than all my earlier
investigations! ;-) ]
 
T

Tarlika Elisabeth Schmitz

Hello Andrew,
After a little further investigation, here are my conclusions:

Andrew said:
Whoever said that?

Got my sources ... :cool:
I do not quite follow. Do you mean as distinct to the shortcuts
that JWS creates for the application itself?

I see the following, albeit minor, problems with the JWS solution. As I
mentioned earlier, for this particular app, JWS is a convenience
solution. I want our customer to automagically pick up the latest
version from their local server, to which we have remote access.

The user shouldn't have to know anything about webstart. I just want
them to click their application icon, which fires up the application and
if need be downloads the latest jars. I don't want them to get prompted
about desktop integration and certificates.

Only when you run JWS for the first time (javaws XXX.jnlp) will the user
be confronted with those prompts. Second time round, even without
desktop integration*, the application will just fire up. Great. So, all
that is needed, first execution by hand before the user gets to click
around.

*I'm not quite sure now, what's the point of the desktop integration? I
can simply create a shortcut which executes "javaws XXX.jnlp". Or am I
missing something?

But: the location of the cache is in the home directory and the user
could - theoretically - delete the cache, in which case he would get
above prompts. The cache can be directed elsewhere via the JWS console
(just call javaws without args). But then all Webstart apps including
those the user might find on the internet would go in that location.

In any case the cache directory needs the user's write permissions
because javaws is executed under the user's id, not with an s-bit on
Unix. So, there is no way you could prevent him from deleting the cache
by mistake or otherwise. No point in re-locating the cache then anyway.
Based on the 'JWSCache' string, on which the only reference
was the Sun forums, I found my way to this..
<http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html>

1.5 - I leave this to those who want to be Sun's testers. I'll look at
it when it's mature.

OK, I think I now know what happened. This week, when I started looking
at JWS, I realized that I had two versions of it on my Win2K machine:
one is part of the JRE 1.4.2, the other one was a standalone
installation. Judging by the file dates, I must've installed the latter
prior to 1.4. Presumably, before 1.4 JWS was not part of the JRE. This
version had a javaws.cfg file, which so many people mentioned on the
net. A lot of the articles are found were dated 2002.

[ This is of interest to me since I want to deploy Saverbeans
ScreenSavers to Win/*nix boxes using JWS, but they need to be
installed in specific directories. * But, to be honest, your
post has got me closer to that goal than all my earlier
investigations! ;-) ]

I think this can only be achieved if you write your own javaws
equivalent. Maybe I'm wrong. At least under 1.4.2 I can't see a solution.

--


Regards/Gruß,

Tarlika Elisabeth Schmitz
 
A

Andrew Thompson

I see the following, albeit minor, problems with the JWS solution. As I
mentioned earlier, for this particular app, JWS is a convenience
solution. I want our customer to automagically pick up the latest
version from their local server, to which we have remote access.

The user shouldn't have to know anything about webstart. I just want
them to click their application icon, which fires up the application and
if need be downloads the latest jars. I don't want them to get prompted
about desktop integration and certificates.

Can you make that first invocation 'invisible' by initiating
and controlling it from a script*? That way it might at least
get around the 'multi-step' process.

Even better if you can run that script on every machine on the
intranet at some inconspicuous hour - like 4am. ;-)

* (Off the wall suggestion, I do not even know if this is possible)

(snip)
*I'm not quite sure now, what's the point of the desktop integration? I
can simply create a shortcut which executes "javaws XXX.jnlp". Or am I
missing something?

JWS also puts the application into the program menu and gives it a
pretty icon! So.. well, no, you're not *really* missing anything.

(snip)
OK, I think I now know what happened. This week, when I started looking
at JWS, I realized that I had two versions of it on my Win2K machine:
one is part of the JRE 1.4.2, the other one was a standalone
installation. Judging by the file dates, I must've installed the latter
prior to 1.4. Presumably, before 1.4 JWS was not part of the JRE.

I actually thought JWS became integrated with the JRE as of 1.3, but
could not confirm that in the quick checks I did at Sun. The documents
I found were all part of the 1.4 docs.
version had a javaws.cfg file, which so many people mentioned on the
net. A lot of the articles are found were dated 2002.
[ This is of interest to me since I want to deploy Saverbeans
ScreenSavers to Win/*nix boxes using JWS, but they need to be
installed in specific directories. * But, to be honest, your
post has got me closer to that goal than all my earlier
investigations! ;-) ]

I think this can only be achieved if you write your own javaws
equivalent.

Yes, I had been approaching that conclusion myself.

I'd still love for anybody to pop in and point us both to
the 'magic' bit we missed, though.
 
T

Tarlika Elisabeth Schmitz

Hello Andrew,

Andrew said:
Can you make that first invocation 'invisible' by initiating
and controlling it from a script*? That way it might at least
get around the 'multi-step' process.

Once "javaws http://myserver/myapp.jnlp" has been run once the app will
simply fire up *without* prompting the user to accept certificates, nor
will JWS prompt about desktop integration after the initial cache download.

Even if newer jars have to be downloaded, JWS will not prompt the user
to accept/reject certificates - I presume, however, this is only the
case if these are signed with the same certificates as previously.

Therefore all you need is a desktop icon which runs the command "javaws
http://myserver/myapp.jnlp". This will work even if the user has
deleted the JWS cache by hand. However, in this case the user would be
prompted to accept the certificates. The desktop integration query can
be suppressed via the WebStart preferences (choose "Never ask to
integrate".)

If you use the JWS created desktop icon instead, "javaws
${usrhome}\...\javaws\cache\indirect\indirect59840.ind" will be
executed. Should the user ever delete his cache including the indirect
file by hand, then this icon would no longer work as with the next
download a new indXXXX.ind file with another random number would be
generated.
Even better if you can run that script on every machine on the
intranet at some inconspicuous hour - like 4am. ;-)
* (Off the wall suggestion, I do not even know if this is possible)

Possible but no need as it is only the first download that causes the
prompts.

If you have the client machines under control executing creating an icon
that executes "javaws http://myserver/myapp.jnlp" rather than desktop
integration seems to be the safer option.
Yes, I had been approaching that conclusion myself.

I'd still love for anybody to pop in and point us both to
the 'magic' bit we missed, though.

We can't be the only WebStart "specialists" in this group ;-)



--


Regards/Gruß,

Tarlika
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top