To reproduce this bug, start jruby as: jruby -J-XstartOnFirstThread
Wait a while as jruby crashes with no warnings or errors printed on the console.
From http://www.eclipse.org/swt/faq.php#carbonapp:
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 follow:
java -XstartOnFirstThread -cp swt.jar:. ControlExample
I tested this with Java 5 and the following command line and it ran fine:
jruby -J-XstartOnFirstThread -e "puts 1"What version of OS X, Java, etc were you running?