Forums Register Login

jar and path

+Pie Number of slices to send: Send
Hi i have a application ho needs to bee shipped out soon and i construckted a jar and in that jar there is a folder with my pictures that my application needs, here is the problem. my application is a trayapp that uses a native method to display the icon pic in the tray, that method needs the absolute path to a xx.ico file.
How can i get that path ? is it possible or must i place my picture folder out side the jar in a nown place ? that is a solution i dont want ! please help thanks
//Rikard
+Pie Number of slices to send: Send
humm think i got it .. i create a tmp file out of the stored picture in jar and from that get the absolut path // Rikard
+Pie Number of slices to send: Send
One answer that I can think of is to pass the location of the .ico file to your native method. If your native code can read .zip/.jar files, then you can include the .ico file in your .jar and tell your native code to look there. Otherwise, you will have to either
a). package the .ico separately and include a .properties file to tell where the .ico is, or
b). Package the .ico file in the .jar file. The first time you go to use the resource, use Java's jar API to extract it from the .jar file and place it in a tempory location on the hard drive (you could specify this using a .properties setting, if you wised....) Then pass the location of that file to your native code and it should be able to find it.
+Pie Number of slices to send: Send
 

Originally posted by Rikard Qvarforth:
humm think i got it .. i create a tmp file out of the stored picture in jar and from that get the absolut path // Rikard


Essentially, my thoughts exactly
+Pie Number of slices to send: Send
he he thanks for the reply some times it help just asking the question to your self stupid huh
it works fine now
//rille
Why should I lose weight? They make bigger overalls. And they sure don't make overalls for tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 814 times.
Similar Threads
jsp - jar - dll
Look and Feel
Packaging 3rd party .jars
New Source code changes are not getting refected
maven clean war
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:19:22.