Mac OS X Snow Leopard를 실행 중이며 OSGi 번들의 활성화 프로그램에서 디스플레이에 액세스하지 않으려 고합니다. 다음은 Mac OS X에서 SWT 디스플레이를 가져올 수 없습니다
내 활성의 시작 방법 :@Override
public void start(BundleContext context) throws Exception {
ExecutorService service = Executors.newSingleThreadExecutor();
service.execute(new Runnable() {
@Override
public void run() {
Display display = Display.getDefault();
Shell shell = new Shell(display);
Text helloText = new Text(shell, SWT.CENTER);
helloText.setText("Hello SWT!");
helloText.pack();
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
});
}
Windows 환경에서이 코드를 호출 작동 잘하지만, 맥 OS XI에 배포하면 다음과 같은 출력을 얻을 : 나는 '
2009-10-14 17:17:54.050 java[2010:10003] *** __NSAutoreleaseNoPool(): Object 0x101620d20 of class NSCFString autoreleased with no pool in place - just leaking 2009-10-14 17:17:54.081 java[2010:10003] *** __NSAutoreleaseNoPool(): Object 0x100119240 of class NSCFNumber autoreleased with no pool in place - just leaking 2009-10-14 17:17:54.084 java[2010:10003] *** __NSAutoreleaseNoPool(): Object 0x1001024b0 of class NSCFString autoreleased with no pool in place - just leaking 2009-10-14 17:17:54.086 java[2010:10003] *** __NSAutoreleaseNoPool(): Object 0x7fff701d7f70 of class NSCFString autoreleased with no pool in place - just leaking 2009-10-14 17:17:54.087 java[2010:10003] *** __NSAutoreleaseNoPool(): Object 0x100113330 of class NSCFString autoreleased with no pool in place - just leaking 2009-10-14 17:17:54.092 java[2010:10003] *** __NSAutoreleaseNoPool(): Object 0x101624540 of class NSCFData autoreleased with no pool in place - just leaking . . .
을 행운없이 -XstartOnFirstThread VM 인수를 사용했습니다. 저는 64 비트 코코아를 사용하고 있지만 32 비트 코코아를 사용해 보았습니다.
탄소에 노력하고 나는 다음과 같은 오류 얻을 : Display 클래스로 디버깅 할 때
Invalid memory access of location 00000020 eip=9c
I이 표시 [] 배열은 널 (null) 참조가 포함되어 있음을 알 수있다.
을 모두 추가하여 해결했습니다. Windows에서 작동합니까? 정말? 나는 그것을 시도해야 할 것이다 ... – andyczerwonka