Cross-platform way to open a file using Java 1.5

后端 未结 8 811

I\'m using Java 1.5 and I\'d like to launch the associated application to open the file. I know that Java 1.6 introduced the Desktop API, but I need a solution for J

8条回答
  •  不知归路
    2020-12-16 18:33

    You can use the OS default way to open it for you.

    • Windows: "cmd /c fileName
    • Linux w/gnome "gnome-open filename"
    • Linux w/Kde ??
    • OSx "open filename"

提交回复
热议问题