--- old/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m 2014-04-11 15:09:46.000000000 +0400 +++ new/src/macosx/native/sun/awt/splashscreen/splashscreen_sys.m 2014-04-11 15:09:46.000000000 +0400 @@ -142,9 +142,14 @@ splash->screenFormat.byteOrder = 1 ? BYTE_ORDER_LSBFIRST : BYTE_ORDER_MSBFIRST; splash->screenFormat.depthBytes = 4; - [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() { - [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]]; - }]; + // If this property is present we are running SWT and should not start a runLoop + char envVar[80]; + snprintf(envVar, sizeof(envVar), "JAVA_STARTED_ON_FIRST_THREAD_%d", getpid()); + if (getenv(envVar) == NULL) { + [JNFRunLoop performOnMainThreadWaiting:NO withBlock:^() { + [NSApplicationAWT runAWTLoopWithApp:[NSApplicationAWT sharedApplication]]; + }]; + } } void