JDK-8125442 : Mac: Only in JavaFX is Desktop not supported
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 7u6
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2012-09-07
  • Updated: 2015-06-17
  • Resolved: 2013-01-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Description
The AWT class Desktop is crucial for rich client applications to be able to interact with other applications on a computer like the user's mail application or PDF viewer. The trouble is, while the Desktop class works on my Mac, it does not when I am running a JavaFX application. I am running 
	Java version: 1.6.0_35
	JavaFX version: 2.2.0-beta-b19

and if I run this trivial program

public class TestDesktop {
	public static void main(String... arguments) {
		System.out.println("Is desktop supported: " + Desktop.isDesktopSupported());
	}
}

the output is "true". However, if I do the same inside a JavaFX application, I get "false.

Since the Desktop object has been part of Java since 1.6, the fact that JavaFX cripples it, is a bug - and, I think, a serious one too.
Comments
We've fixed 8005465 in JDK (7u14 and 8), so AWT can now be initialized in headful mode on the Mac together with FX. Therefore, if you force AWT initialization before calling FX's launch(), it should start up just fine, and the Desktop API should be available. I realize that the specific startup order is a nuisance. This is going to be addressed in FX with a fix for RT-20784. After it's fixed, you'll also be able to initialize AWT after the FX has started already. Since there's nothing else to fix specifically for this issue, I'm closing it a a duplicate of RT-20784.
23-01-2013

That sounds wonderful. Thanks for the feedback Anthony ��� looking forward to Lombard.
11-09-2012

This is a more generic issue of interoperability between FX and AWT/Swing APIs. In this particular case the Desktop class belongs to AWT, and AWT is only able to be initialized in the headless mode on the Mac when running with FX currently. We're going to address this issue for Lombard.
11-09-2012

Since the purpose of the Desktop class is to handle different OS'es in a uniform maner, this bug forces developers to resort to platform specific programming, along the lines of if(isMac()) doItTheMacWay(); else (isWindows()) doItTheWindowsWay();
07-09-2012