码迷,mamicode.com
首页 > 其他好文 > 详细

Why -XstartOnFirstThread

时间:2014-12-08 14:02:24      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:http   io   ar   os   sp   java   on   art   cti   

在Mac上运行SWT程序必须加XstartOnFirstThread标记。
如果是AWT/Swing不能加XstartOnFirstThread。下面是原因:

Q: On Mac Carbon, how do I run an SWT application from the command line?
A: If you run a Java application that uses Carbon via JNI, the application is not registered with the OS as a ‘normal‘ UI application. As a consequence, it has no entry in the dock and it cannot be activated. AWT (or Swing) based applications don‘t have this problem because they seem to use undocumented SPI to register themselves.
To work around this problem you‘ll have to pass the -XstartOnFirstThread option to the java executable as follows:

java -XstartOnFirstThread -cp swt.jar:. ControlExample

If you want to run a bundled application, take a look at this article.

https://www.eclipse.org/swt/faq.php

Why -XstartOnFirstThread

标签:http   io   ar   os   sp   java   on   art   cti   

原文地址:http://my.oschina.net/chunquedong/blog/353749

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!