Packaging Utility limitations regarding additional files/folders

Packaging Utility limitations regarding additional files/folders

Hi, I have an existing java app which I am trying to adapt for upload to AppUp. Under the current configuration, I have a launcher jar then a few directories that sit alongside rather than within (for things such as sound effects, setup csv files, and so on). Then within the app they are loaded as objects with path relative to System.getProperty("user.dir"); For ease of development & future releases I would like to keep this structure consistent between my existing app and that which will be uploaded to AppUp. I have observed that after feeding my main AppName.jar (plus dlls & other jars) through the Packaging Utility, the resulting jar has AppName_lib directory plus my original AppName.jar within. I then have to manually copy my extra directories into the jar at the same level as AppName_lib. Running it through the validation utility launches the app and everything works - great. My question is will this manual manipulation of the final jar cause issues for the eventual upload to AppUp, or for the end users who download it? If yes, also will the packaging utility be enhanced at all in future to allow additional dirs in this manner? Also if there's a much simpler way I could be doing this then that would be appreciated too :) Thanks
5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Just include all the files that you require within your main jar file (i.e include them, retaining the original directory format).

Then to access within your code, simply use something like:

InputStream myInputStream = ClassLoader.getSystemResourceAsStream("SoundEffects/whizzbang.wav");


URL imageURL = ClassLoader.getSystemResource("Images/background.jpg");

Then you can use FileInputStream fis = new FileInputStream(myInputStream), or get the URI via the URL.toURI() method etc so you can access the files as required.

Note that this method will also work within your non-jar'ed IDE development environment, as well as your packaged App, so it's a robust mechanism for both development and distribution phases.


Thanks for the reply. I have had a think about this and whilst it would work in the way you describe, unfortunately I think it would be unwise to change my current app in this way for a couple of reasons.

Mainly, outside of the AppUp world, my app has a self-updating mechanism whereby upgrades can be applied to the main jar itself, other jars/dlls, and these separate config files. Keeping things as separate as possible makes this update process nice and lightweight, as it only contains the components that need updating (reduced size of download, reduced impact on the user, easier to develop and deploy). If the currently separate config files were to be bundled into the main jar file, then this update process would become more reminiscent of a complete reinstall each time it happened. Furthermore my app in its current state is already available in other places and in use (it's not just a case of switching for my development environment), so in my strive for consistency this refactor would mean forcing an update/reinstall on my existing users simply because the product's being put on AppUp.

As such, I guess my original question still stands. Unless there's another way I could do this, aside from relenting on my consistency ideology (!) Is there any problem with my manual manipulation of the final post-packaged jar, and will the packaging utility be enhanced to allow for this in future?

Many thanks.

Hi Truphone,
I don't think there should be an issue with manual manipulation of the jar file. As long as all your need files are put unloaded into the user device and they can run the app through the store, you should be good to go.

Have you had a chance to beta test your app? You can verify on your own machine to see if it works.

Check out this video on how to beta test. I highly recommend all developers to beta test their apps.

If you need more help, please email me.

I'm a techincal marketing engineer and I assist developers like yourself to push their app into the store.


Nice post..

Leave a Comment

Please sign in to add a comment. Not a member? Join today