Using swt with jruby

Hey jruby coders, Im trying to test out swt with Jruby, however im
trouble grabbing the org.eclipse.swt. Im on Ubuntu Linux, and installed
these packages through synaptic:


In the jirb, I try creating a Display object for instance:
d = org.eclipse.swt.widgets.Display = new.

But it cannot find that package. Ideas on how to set this up?

2009/9/19 Aaron McLeod [email protected]

But it cannot find that package. Ideas on how to set this up?

Aaron McLeod

Have you done a

require ‘path/to/jar’

for the relevant files? Can you provide more detail on the message that



Well i looked around through /usr/lib and /usr/bin to see where the
may have installed to specifically, but i couldnt find the swt.jar. So I
unpacked the zip i downloaded initially, and in the jirb typed require
‘path/to/jar’ as you suggested, and it returned true. Was able to create
small window using Display and Shell classes. Thanks james :).

Havent touched it in a little while actually, been busy at work. Might
into it, as I have a simple chat client thing working with ruby/jruby.
thinking of implementing swt for the GUI.

Is anyone making use of Glimmer? I looked at that last year and would
to try it again for JRuby/SWT work. Today I use JRuby as an embedded
scripting language in an eclipse RCP app, but do all the SWT in java.
like to start accessing SWT more directly and Glimmer looks like a nice

Hi Aaron!

How is your exploration of JRuby + SWT going?

We have several systems in production with that setup, so feel free to
ask questions. We are very interested in building a community around
JRuby + SWT for mutual support.

I am usually on #jruby with nick donV.

With kind regards
Uwe K.
Datek Wireless

Is your own 'framework" available for others to look at?


We experienced that when writing JRuby to access SWT/JFace, the amount
of code shrinks so much that a frameworks is less attractive. We have
now gained a bit of experience, and may re-evaluate Glimmer, but most
likely we keep our own “framework” which consists of two modules with
utility methods, one for lo level and one for high level GUI

Med vennlig hilsen
Uwe K.
Romerike Jujutsu Klubb

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs