问题
I just finished my java application.
I add a chm
help file, but the problem is "how can I open it, how can I get its ? link wherever the machine which the jar file run from".
I tried to use the command
Runtime.getRuntime().exec("hh.exe myhelpfile.chm");
it works but when I change the machine the link become incorrect,
my chm file
回答1:
Are you trying to access the file from another machine or the same machine? If accessing the file from same machine then add your .chm file in the classpath.
回答2:
Once the .CHM is inside the jar it isn't a file. If you need to launch it, you'll have to extract it first and write it to the filesystem.
You'll have to open an output file and copy the .chm jarEntry to the file before issuing the exec() method call.
For further information see: How to open help file in executable jar
来源:https://stackoverflow.com/questions/37069113/call-a-help-file-in-java-application