Results 1 to 4 of 4
- 05-06-2009, 10:12 PM #1
Member
- Join Date
- Dec 2008
- Posts
- 64
- Rep Power
- 0
How to get cached jar file name in web start...
So before I moved this app to web start I performed the following:
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.Java Code:File jarFile = new File(WinUtils.class.getProtectionDomain(). getCodeSource().getLocation().toURI());
- 05-06-2009, 10:29 PM #2
Member
- Join Date
- Dec 2008
- Posts
- 64
- Rep Power
- 0
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???
- 05-06-2009, 11:06 PM #3
Member
- Join Date
- Dec 2008
- Posts
- 64
- Rep Power
- 0
Just posting thoughts here as well and things I am trying...
Works as a standalone app, does NOT work with JNLP returns null.Java Code:URL url = MyClass.class.getClassLoader(). getSystemResource("com/some/path/MyClass.class");
- 05-06-2009, 11:24 PM #4
Member
- Join Date
- Dec 2008
- Posts
- 64
- Rep Power
- 0
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
-
How do you start a Java program from the "Start" menu under Windows?
By ScottVal in forum New To JavaReplies: 5Last Post: 03-20-2009, 10:04 PM -
"Cached Item Was Locked" causing Select Statement: Hibernate + EHCache
By cloutierm in forum Advanced JavaReplies: 0Last Post: 03-15-2009, 11:53 PM -
cached pages or backups
By angryboy in forum Suggestions & FeedbackReplies: 8Last Post: 03-02-2009, 03:29 PM -
Adding lines at start and end of the text file
By phani532 in forum New To JavaReplies: 5Last Post: 08-27-2008, 03:12 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks