Search code examples
javainstallationjarexecutable

Will my executable jar include files I added in the file structure?


I'm trying to comprehend how creating executable jars and file paths work, so please bear with me.

I have a small program, which is supposed to upload some Firmware to Servers. These Firmwares have a combined size of about 650MB. All in all, the Project Folder takes up about 2.2GB of space.

In the program itself, I have some Strings that refer to the name of the folder that contains the firmware.

"src\\com\\java\\myProgram\\data\\bios_fw\\"+biosFWPath+"\\"+biosFW

When testing in the IDE, this works without problem.

So here's my question(s): Will this still work if I build the program as executable jar? I have already noticed that the jar I created holds only about 450MB. Does it even contain the firmware then? And if it does, will the program be able to find the path specified?

Furthermore, what would be the proper way of "installing" these folders together with the jar on a Users PC?

Thanks!


Solution

  • As a .jar file is a java archive file, you can open it and look yourself as we don't know how you build your .jar. But considering the future, I would remove the absolute path and use a relative path to a directory where you can insert the firmware in case the fw got updated, so you don't have to build your program each time.

    The proper way, when you want to keep the FW in your project is using ClassLoader.