Open a path with Desktop.open() from java on ubuntu (linux)

后端 未结 4 2243
星月不相逢
星月不相逢 2021-02-15 10:09

From my application written in java I want to open a folder, using the operating system file explorer.

I use Desktop.open(new File(path))

This works fine on wind

4条回答
  •  半阙折子戏
    2021-02-15 10:34

    I was running into what sounds like the same issue on Mint 13. From what I can tell, changes to mime handling for opening directories has broken the java Desktop api. I was able to work around the problem by editing

    ~/.local/share/applications/defaults.list
    

    and adding this line

    x-directory/normal=nautilus.desktop
    

    I'm running Mint 13 Cinnamon with java version "1.7.0_05"

提交回复
热议问题