Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Examples for writing an application in JRuby/SWT
Branch: master


JRuby SWT Cookbook

JRuby and SWT is a great platform for writing cross-platform desktop applications. This repo contains 
examples of how to get started.

Why JRuby/SWT?

  * Fast, compatible Ruby implementation.
  * JRuby and SWT are flawlessly cross-platform.
  * SWT has native widgets (for the most part).
  * SWT powers Eclipse, so there's nothing you need that it doesn't do.
  * You don't need to touch Java! Write everything in Ruby.


You will need to run these examples with JRuby. Get it from

*API Docs*

The apidocs.tar.gz file contains SWT API reference docs. Untar the file and open apidocs/index.html in 
your browser. The comments in all the examples refers to files in these docs. They are the Java api, however
JRuby does a great job of interfacing with Java, so you can usually just call into them as if they were Ruby 
classes and methods.

Running Examples

On Windows and Linux:

  $ jruby ex1_button/ex1_button.rb

  $ jruby -J-XstartOnFirstThread ex1_button/ex1_button.rb
Something went wrong with that request. Please try again.