The “easiest” way to create a CHM file is to use Microsoft's “HTML Workshop” .
Basically, an “HTML Workshop” is a .exe file (hhc.exe) that compiles the specified HTML, CSS, and JS folder structure into a single .chm file that is no longer being edited.
So, in your case, when you want to create a .chm file in java, you need to save your HTML, JS and CSS sources in the correct structure for hhc.exe (see the "Workshop HTML" documentation on how this structure should look) .
Once this is done, copy the hhc.exe file from its installation directory to the HTML source folder and run it. This can be achieved by calling the batch script application from your java application, which can be achieved with the following code:
Process p = Runtime.getRuntime().exec("host call mySuperCoolBatchScript.bat); p.waitFor();
Once the compilation process is complete, delete the previously copied hhc.exe file from the original HTML folder and execute.
I hope this helps, let me know if you have any questions.
source share