-1

I need to distribute a java application as exe, but my jar depends on xml files that are read/written in by the program.

I have tried jar to exe tools (NSIS, jar2exe) but non of them seem to have an option to include files on which the program depends.

My actual question would be : how do I include both the jar and xml files in an exe ?

Thank you for your help !

leas
  • 329
  • 8
  • 17
  • Eclipse has the option. However, how do you hope to write the files back if they are part of the jar/exe? – Steve Smith Jun 05 '17 at 10:23
  • Is it mandatory to distribute the full application in a single fat exe? Or would it be enougt to have an .exe file which launches the app? – alvaro Jun 05 '17 at 10:37
  • @alvaro it's preferable to have a single exe – leas Jun 05 '17 at 11:52
  • @SteveSmith I am sorry I didn't express myself correctly, they are not part of the jar, but my application is dependent on them to work correctly – leas Jun 05 '17 at 11:56
  • You can either zip up the exe with the required files, or get the exe to generate them if they don't exist. – Steve Smith Jun 05 '17 at 12:37
  • I will try the zip the exe with the files, thank you ! – leas Jun 05 '17 at 12:39

1 Answers1

0

Your jar files should not depend on xml which are read or write by your application. Jar should contain only application code. and Your xml's should be put on some location to read/write. Jar should be your application code package. if it genrates, write or update some xmls those should be put on a separate location from jar files.

Pradeep Singh
  • 1,094
  • 1
  • 9
  • 24
  • That's the case, but how do I turn both the jar and xml files into exe ? – leas Jun 05 '17 at 11:54
  • 1
    This might be helpful http://stackoverflow.com/questions/16524932/creating-and-executable-jar-file-that-uses-an-external-xml-file – Pradeep Singh Jun 05 '17 at 12:27