How to launch a file protocol URL with an anchor from Java?

前端 未结 5 1117
深忆病人
深忆病人 2021-01-04 09:08

From a Java program, I need to launch the default browser on a local HTML file, pointed to an anchor inside the file. In Java SE 6, the java.awt.Desktop.browse method will

5条回答
  •  耶瑟儿~
    2021-01-04 09:38

    You could try using BrowserLauncher2. It's a small and self-contained cross-platform library to open the default browser. It handles anchors perfectly.

提交回复
热议问题