| Author |
Pinning down the location of a jar file
|
Greg Jewell
Greenhorn
Joined: Mar 08, 2002
Posts: 10
|
|
Hi All, I have a class inside a jar that wants to read the containing jar's manifest. Given that I don't know where on the machine the jar will be placed, I don't know how to instantiate a JarFile object. How do I determine the location of the jar in order to get a JarFile or JarURLConnection object? Thanks, Greg Jewell
|
 |
Petr Blahos
Ranch Hand
Joined: Apr 28, 2004
Posts: 131
|
|
The output of this is: jar:file:/D:/cygwin/home/petr/java/jar/jjj.jar!/my/package/jar I hope it will help. Petr
|
Get a better web browser:<br /><a href="http://www.mozilla.org/products/firefox/switch.html" target="_blank" rel="nofollow">http://www.mozilla.org/products/firefox/switch.html</a>
|
 |
Petr Blahos
Ranch Hand
Joined: Apr 28, 2004
Posts: 131
|
|
Oh, BTW there is a _VERY_ nice article starting with class loader explanation, going on through reflection to runtime code generation: http://www-106.ibm.com/developerworks/java/library/j-dyn0429/ Enjoy! P.
|
 |
Greg Jewell
Greenhorn
Joined: Mar 08, 2002
Posts: 10
|
|
|
Thank you very much, Petr. This is exactly what I was looking for.
|
 |
 |
|
|
subject: Pinning down the location of a jar file
|
|
|