Hi. my name is kenny and i am working on a program that requires 2 seperate jar files. the first jar is what contains the majority of the program while the second contains various updates mainly subclasses of the Entity class. the Entity class represents interactive objects within the program and i want to be able to update these by simply downloading the most recent jar from a website. but i want the project to come with an original update jar so i thought, why not include both in a another jar file that extracts itself? well, i am trying to do that but i have hit a few snags:
1) i do not know how to get a file within a jar to be able to reference the containing jar.
2) I was wondering if instead of extracting the jar, it would be possible to simply keep them in the jar and have it use the jar tool to update itself.
3) i do not know how to get the jars to reference each other without the locations already being known.
4) there is no way to set the destination when extracting the jar so i cannot reference that file location.
5) much much more mostly stemming from my inexperience with jar and zip files.
can anyone please help me with these problems and give some advice?
no. thank you for the link.
could you add the functionality to download the update within the main program? Maybe a 'get latest update' button. That way the program can store the filename and path when it downloads the updated jar file.
i was planning on having the main program attempt to get an update every time it starts up. but, it first needs to have default that comes with the jar which is why i wanted an auto extractor. wither that or i have the program update it's own jar using Runtime.getRuntime().exec("jar uf program.jar update.jar");