JDK-8321317 : Desktop.browse method fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 21
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2023-11-28
  • Updated: 2024-03-11
  • Resolved: 2023-12-08
Related Reports
Duplicate :  
Description
A DESCRIPTION OF THE PROBLEM :
I am facing a similar issue as the one previously posted on JDK 21 (https://bugs.openjdk.org/browse/JDK-8270269). The last update for this issue was on October 27, 2021, and the status is still marked as 'In Progress.' Could you please let me know if there have been any updates on this issue and what the current status is ?

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
URL will open in system assigned browser
ACTUAL -
Exception in thread "main" java.io.IOException: Failed to open https://www.google.com. Error message: CoInitializeEx() failed.
at java.desktop/sun.awt.windows.WDesktopPeer.ShellExecute(WDesktopPeer.java:115)
at java.desktop/sun.awt.windows.WDesktopPeer.browse(WDesktopPeer.java:101)
at java.desktop/java.awt.Desktop.browse(Desktop.java:530)
....

---------- BEGIN SOURCE ----------
Desktop desktop = getDesktop();
desktop.browse(new URI("https://www.google.com"));
---------- END SOURCE ----------


Comments
Per description of the bug which refers to JDK-8270269 and per Praveen's comment, it's a duplicate of JDK-8270269. A simple test case is hard to provide because it requires a native library which calls CoInitializeEx(NULL, COINIT_MULTITHREADED) and then calls Desktop API.
08-12-2023

Checked with attached test case in Windows 11 issue is not reproducible, URL is opened in Mozilla Firefox Test Result ============ 8u391: Pass JDK 11: Pass JDK 17: Pass JDK21: Pass JDK22ea26: Pass Mail to submitter ================ Please share short clipping of the issue.
05-12-2023

Duplicate of JDK-8270269
05-12-2023