관리 메뉴

초보 프로그래머의 하루

[OSX,SWT] Error Display must be created on main thread due to Cocoa restrictions. 본문

Java

[OSX,SWT] Error Display must be created on main thread due to Cocoa restrictions.

nabina 2012.12.03 22:47

문제:

***WARNING: Display must be created on main thread due to Cocoa restrictions.

Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access

at org.eclipse.swt.SWT.error(SWT.java:4361)

at org.eclipse.swt.SWT.error(SWT.java:4276)

at org.eclipse.swt.SWT.error(SWT.java:4247)

at org.eclipse.swt.widgets.Display.error(Display.java:1068)

at org.eclipse.swt.widgets.Display.createDisplay(Display.java:825)

at org.eclipse.swt.widgets.Display.create(Display.java:808)

at org.eclipse.swt.graphics.Device.<init>(Device.java:130)

at org.eclipse.swt.widgets.Display.<init>(Display.java:699)

at org.eclipse.swt.widgets.Display.<init>(Display.java:690)

at kr.or.utac.testAlienReader.TestAlienReaderUI.<init>(TestAlienReaderUI.java:148)

at kr.or.utac.testAlienReader.ExecuteTestAlienReader.main(ExecuteTestAlienReader.java:16)


해결:

-XstartOnFirstThread

Tag
, ,
공유하기 링크
1 Comments
  • 프로필사진 Favicon of http://itmining.tistory.com BlogIcon 금광캐는광부 2017.01.17 11:33 신고 어떻게 에러 해결하셨다는 건가요? XstartOnFirstThread게 무슨 뜻인지 잘 모르겠습니다.


    -------

    java -jar SpriteSplitter.jar
    ***WARNING: Display must be created on main thread due to Cocoa restrictions.
    org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:4533)
    at org.eclipse.swt.SWT.error(SWT.java:4448)
    at org.eclipse.swt.SWT.error(SWT.java:4419)
    at org.eclipse.swt.widgets.Display.error(Display.java:1089)
    at org.eclipse.swt.widgets.Display.createDisplay(Display.java:840)
    at org.eclipse.swt.widgets.Display.create(Display.java:823)
    at org.eclipse.swt.graphics.Device.<init>(Device.java:129)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:722)
    at org.eclipse.swt.widgets.Display.<init>(Display.java:713)
    at org.eclipse.swt.widgets.Display.getDefault(Display.java:1419)
    at org.sprite.splitter.Windows.open(Windows.java:75)
    at org.sprite.splitter.Windows.main(Windows.java:65)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)

    -------

    제 에러는 위와 같이 뜹니다 ㅠ
댓글쓰기 폼