Archaeopteryx from within JRuby

9 views
Skip to first unread message

Christian

unread,
Aug 23, 2011, 6:08:24 AM8/23/11
to Archaeopteryx
Here I describe (by way of example) how to use Archaeopteryx from
within JRuby (in progress).
JRuby: http://www.jruby.org


Trying JRuby:

1. download 'jruby-1.x.x-binary.tar.gz' (for Linux) from:
http://www.jruby.org/download
2. uncompress
3. create a link/alias named 'jruby' to '/path/to/jruby-1.x.x/bin/
jruby'
4. produce a first JRuby program, for example:

include Java
JFrame = javax.swing.JFrame
JLabel = javax.swing.JLabel
frame = JFrame.new
label = JLabel.new("Hello World from JRuby!")
frame.add(label)
frame.setDefaultCloseOperation(JFrame::EXIT_ON_CLOSE)
frame.pack
frame.setVisible(true)
puts 'done!'

5. % jruby my_first_jruby_prg.rb


Using Archaeopteryx (http://www.phylosoft.org/archaeopteryx/) from
within JRuby:
1. download 'forester.jar' from: http://www.phylosoft.org/archaeopteryx
2. write a JRuby program, in the most simple case something like this:

include Java

require 'forester.jar'

aptx =
org.forester.archaeopteryx.Archaeopteryx.createApplication( nil )

puts 'done!'

3. launch with:
% jruby -I /path/to/forester.jar aptx.rb

Note. Do not include 'forester.jar' itself in the path.


Reply all
Reply to author
Forward
0 new messages