Results 1 to 4 of 4
  1. #1
    fxRichard is offline Member
    Join Date
    Dec 2008
    Posts
    64
    Rep Power
    0

    Default How to get cached jar file name in web start...

    So before I moved this app to web start I performed the following:

    Java Code:
      File jarFile = new  File(WinUtils.class.getProtectionDomain().
                       getCodeSource().getLocation().toURI());
    Once moved to web start this returns the location via http where the source for the jar file was downloaded. I have tried File blah = new File("."); which will only give me the path, I still need the name. Anybody have any input? The reason for this is the app determined if it is being run on Vista, if so it sets up vista to run the app as admin and restarts itself so it has the correct priveleges/permissions etc.

  2. #2
    fxRichard is offline Member
    Join Date
    Dec 2008
    Posts
    64
    Rep Power
    0

    Default

    Another alternative would be to restart the JVM which I am doing now but before I moved it to Web Start I was obtaining the jar file name and obtaining the location of javaw.exe etc and running the command via Runtime.getRuntime.exec(); Perhaps there is another way to restart the jvm without having to do this???

  3. #3
    fxRichard is offline Member
    Join Date
    Dec 2008
    Posts
    64
    Rep Power
    0

    Default

    Just posting thoughts here as well and things I am trying...

    Java Code:
    URL url = MyClass.class.getClassLoader().
                          getSystemResource("com/some/path/MyClass.class");
    Works as a standalone app, does NOT work with JNLP returns null.

  4. #4
    fxRichard is offline Member
    Join Date
    Dec 2008
    Posts
    64
    Rep Power
    0

    Default

    Well after looking around as to where/how JNLP stores it's jar files, it looks like it caches them with random names in random folders in a specific location meaning it will probably not be possible to locate the file without some nightmare code to do it....just an assumption here....still looking, only other way is to write another app that is an interface to my install app and downloads it etc lol

Similar Threads

  1. Replies: 5
    Last Post: 03-20-2009, 11:04 PM
  2. Replies: 0
    Last Post: 03-16-2009, 12:53 AM
  3. cached pages or backups
    By angryboy in forum Suggestions & Feedback
    Replies: 8
    Last Post: 03-02-2009, 04:29 PM
  4. Adding lines at start and end of the text file
    By phani532 in forum New To Java
    Replies: 5
    Last Post: 08-27-2008, 04:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •