Java Web Start Classpath?

Discussion in 'Java' started by brent5282@gmail.com, Nov 19, 2008.

  1. Guest

    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?
    , Nov 19, 2008
    #1
    1. Advertising

  2. wrote:
    > 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
    Mark Thornton, Nov 19, 2008
    #2
    1. Advertising

  3. Roedy Green Guest

    On Wed, 19 Nov 2008 11:49:50 -0800 (PST), wrote,
    quoted or indirectly quoted someone who said :

    >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'.
    Roedy Green, Nov 20, 2008
    #3
  4. On Nov 20, 6:49 am, wrote:
    > ...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.

    --
    Andrew Thompson
    http://pscode.org/
    Andrew Thompson, Nov 21, 2008
    #4
  5. Guest

    On Nov 19, 3:14 pm, Mark Thornton <> wrote:
    > wrote:
    > > 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


    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.
    , Nov 23, 2008
    #5
  6. wrote:
    > On Nov 19, 3:14 pm, Mark Thornton <> wrote:
    >> wrote:
    >>> 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

    >
    > 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
    Mark Thornton, Nov 23, 2008
    #6
  7. On Nov 23, 4:57 pm, Mark Thornton <> wrote:
    > wrote:
    > > On Nov 19, 3:14 pm, Mark Thornton <> wrote:
    > >> wrote:
    > >>> 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

    >
    > > 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 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 :)
    FutureScalper, Nov 24, 2008
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Flip
    Replies:
    3
    Views:
    7,258
    Tony Morris
    Feb 9, 2004
  2. Gabe
    Replies:
    3
    Views:
    1,070
  3. JW
    Replies:
    3
    Views:
    649
    Andrew Thompson
    Sep 21, 2004
  4. Replies:
    2
    Views:
    752
  5. Replies:
    2
    Views:
    1,101
    Mike Schilling
    Mar 2, 2008
Loading...

Share This Page