Call a help file in java application

会有一股神秘感。 提交于 2019-12-12 02:08:38

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!