Search code examples
javanetbeansderbypackaging

Packaging a java application as exe installer with an updatable derby database in netbeans


I created a java application that uses an embedded derby database in netbeans. I managed to package the application as an exe installer so as to install on other systems. The problem is that when I install on other systems, the application tries to locate the database using the original url (which is on the computer I used in development). How can I solve the problem of packaging so that the database is packaged along with all the required classes of the application?


Solution

  • Well I believe I may have found a way around my problem. I ended up compressing the database folder into a jar file and adding it to the project library of my application. When the application is packaged and installed on another system, I put in a code that creates a directory inside the application folder and another code to extract the contents of the jar file (the database) and place them in the newly created directory. Only problem I am facing now is what I believe to be a permissions problem because while I am able to create the folder to place the extracted database in, the code to extract the database jar file seems not to be working.