Java Web Start Classpath?

B

brent5282

Is there a property which a JWS-launched application can use at
runtime to determine where it's classpath is in the physical
filesysystem? Since JWS "caches" applications, who knows whether it
holds jars somewhere or raw class files somewhere? Where is that
somewhere, in the filesystem?
 
M

Mark Thornton

Is there a property which a JWS-launched application can use at
runtime to determine where it's classpath is in the physical
filesysystem?

No. It used to be possible by obtaining the URL of a resource, but that
was recently changed --- the URL now reflects the original location and
not the cached location. Why do you want to know the location?

Mark Thornton
 
R

Roedy Green

Is there a property which a JWS-launched application can use at
runtime to determine where it's classpath is in the physical
filesysystem? Since JWS "caches" applications, who knows whether it
holds jars somewhere or raw class files somewhere? Where is that
somewhere, in the filesystem?

JWS just gets apps started. I would expect the embedded class path in
the manifest in the jar would take it from there.

You can also specify multiple jars to download in the JNLP.

See http://mindprod.com/jgloss/jnlp.html
--
Roedy Green Canadian Mind Products
http://mindprod.com
Your old road is
Rapidly agin'.
Please get out of the new one
If you can't lend your hand
For the times they are a-changin'.
 
A

Andrew Thompson

...Since JWS "caches" applications, who knows whether it
holds jars somewhere or raw class files somewhere?  

Probably the person that went into the Java Control
Panel for that machine, and changed the 'Select the
compression level for JAR files:' from 'None' to..
whatever..
..Where is that somewhere, in the filesystem?

Again, wherever that same person directed the
'Select the location where temporary internet files
are kept:' (very poorly named, BTW) to some place
other than the 'standard' location.

The end user can change either of those things at
will, if they have admin privileges and can access
the control panel etc.

So see Mark's reply, but I'll ask an even more specific
form of the same question. What *feature* do you wish
to provide to the user, by knowing that location?

There are doubtless better ways to achieve that,
given Sun's reluctance to part with information it
regards as no business of any Java app.
 
B

brent5282

No. It used to be possible by obtaining the URL of a resource, but that
was recently changed --- the URL now reflects the original location and
not the cached location. Why do you want to know the location?

Mark Thornton

I need to know the location so that "rmiregistry" spawned as a
separate process from within a JWS launched application can be given
the location of the app's classpath. It's inconvenient that there
isn't just a simple classpath property to use, but I worked around it.
 
M

Mark Thornton

I need to know the location so that "rmiregistry" spawned as a
separate process from within a JWS launched application can be given
the location of the app's classpath. It's inconvenient that there
isn't just a simple classpath property to use, but I worked around it.

You could instead use the web server included in JRE6 to deliver the
classes. You then give rmiregistry something like
http://myhostname:81/somepath

The web server can use ClassLoader.getResourceAsStream to read the data
from where ever WebStart has cached it.

Alternatively you could just supply the original url from which WebStart
downloaded the jars.

Mark Thornton
 
F

FutureScalper

You could instead use the web server included in JRE6 to deliver the
classes. You then give rmiregistry something likehttp://myhostname:81/somepath

The web server can use ClassLoader.getResourceAsStream to read the data
from where ever WebStart has cached it.

Alternatively you could just supply the original url from which WebStart
downloaded the jars.

Mark Thornton

Thanks for the ideas. The application must be able to run offline,
which eliminates your last suggestion as an option. I assume it would
have to be online for that to work, but I'm not that smart so maybe
I'm wrong :)
 

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

Similar Threads


Members online

Forum statistics

Threads
473,982
Messages
2,570,189
Members
46,735
Latest member
HikmatRamazanov

Latest Threads

Top