How to open user system preferred editor for given file?

后端 未结 4 1000
花落未央
花落未央 2020-11-29 08:55

I\'m trying to figure out how to open the system preferred editor for a given file.

Say, we have a file manager, written in Java. User goes to folder and sees the li

4条回答
  •  悲哀的现实
    2020-11-29 09:16

    Seems that if you can't use java.awt.Desktop you have to distinguish between the OSes: Windows:

    RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL 
    

    Linux:

    edit 
    

    Mac:

    open 
    

    HTH. Obviously, that is not very portable...

提交回复
热议问题