开发者

Open a file in a running java jar

If I have a jar file that is running, what is the best way for it to handle the opening of launched files to it - is there any cross platform way of doing this or would I have to make it a native application via something like JSmooth first (would like to avoid as much as possible)?

Say the jar file is running and is associated with text files; when I open a t开发者_运维问答ext file I want it to open up in a running instance.

I'm guessing I would have to check to see if the jar is running; but how do I do this in JAVA?

If I do find the jar is running what communication method would be best to tell the running instance to open the file?


Open a socket and check everytime you open an application if it's already running. If it is just send the file location to the instance already open and close the duplicated one.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜