On Fri, 21 Aug 2026 03:45:26 GMT, Prasanta Sadhukhan <[email protected]>
wrote:
>Desktop.browse() should be used, as it is meant to be, to open URI in browser.
No, that is not the case. The spec clearly states that opening the URI in the
browser is only one option, and if there is another application registered for
a specific URI, it should be called.
> It is not to be thought of another gateway to Runtime.exec() or
> ProcessBuilder to launch executables arbitrarily.
It was; it is the same thing. Just read this part of the spec: "the application
registered for handling {@code URIs} of the specified type is invoked", and the
only difference is that on platforms that do not support dispatching via the
os, the jdk will be able to implement direct calls to the browser, editor, and
file manager, like on some really old linuxes. But as of now, there are no
supported platforms which do not support it, so windows, macOS, and even linux
used that "machinery" until it was changed for some reason and now contradicts
the spec.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/32247#issuecomment-5376005524