How to Package External files with Electron


#1

In my Electron application, I have a button in which a user can click which triggers node’s child_process and runs an external .jar file in the background:

exec(java -jar encoder.jar -i filein -o fileout, function(err, stdout, stderr)

The actual .jar file is located within the root directory of the project. When running in development mode(unpackaged) this works great. However, when I package it and run the application, I get the following error:

There was an error: Error: Unable to access jarfile encoder.jar

Is there anyway to include the jar file when packaging the app?