nathanpowell.org

Running, hacking and being awesome.
  • Home
  • Current Schedule
  • Personal Records

JRuby

Published by Nathan Powell on April 22, 2007 12:15 am under programming

One of the cooler things that was presented today at GoRuCo2007 was a talk by Nick Sieger on JRuby. JRuby is a somewhat complete implementation of Ruby in Java.

Like most talks I have seen given, it wasn’t so much the talk itself that was informative, it’s was the piquing of interest in the topic that made the difference. After listening to what Nick had to say, I was interested in checking out what JRuby had to offer.

Installation in Ubuntu was easy peasy.

mkdir /usr/local/bin/jruby
svn co svn://svn.codehaus.org/jruby/trunk/jruby /usr/local/bin/jruby
export JRUBY_HOME="/usr/local/bin/jruby"
cd /usr/local/bin/jruby
ant test

That does assume that ant is installed, configured and in your path, but that is another topic…on my system it already was (Though I haven’t messed with Ant or Java in a long time, so I don’t remember why it was set up already).

After that it’s a simple matter of trying it out (I found this example on the web site for JRuby).

require 'java'
include_class 'java.util.TreeSet'
set = TreeSet.new
set.add "foo"
set.add "Bar"
set.add "baz"
set.each do |v|
puts "value: #{v}"
end

Then from the command line:

jruby test.rb

Badabing, it runs

value: Bar
value: baz
value: foo

Give it a whirl…it’s neato.

2 Comments so far

  1. Nick Sieger on April 23rd, 2007

    Hey Nathan, thanks for the kinds words! Glad to hear your initial experience w/ JRuby was positive. If you ever have a practical application for JRuby and have a question, don’t hesitate to send me a note.

  2. Nathan on April 23rd, 2007

    Nick, thanks and will do.

    My mind is already going over some possibilities.

    I think the fast track you folks have put development on bodes well for JRuby’s success. Keep up the good work.

Posting your comment.

  • Search

  • Archives

    • July 2010 (2)
    • June 2010 (6)
    • May 2010 (2)
    • February 2010 (1)
    • January 2010 (1)
    • December 2009 (2)
    • September 2009 (2)
    • August 2009 (4)
    • July 2009 (4)
    • June 2009 (2)
    • May 2009 (3)
    • April 2009 (1)
    • March 2009 (3)
    • February 2009 (5)
    • January 2009 (4)
    • December 2008 (5)
    • November 2008 (2)
    • October 2008 (10)
    • September 2008 (4)
    • August 2008 (10)
    • July 2008 (11)
    • June 2008 (14)
    • May 2008 (15)
    • April 2008 (10)
    • March 2008 (16)
    • February 2008 (17)
    • January 2008 (37)
    • December 2007 (21)
    • November 2007 (30)
    • October 2007 (29)
    • September 2007 (22)
    • August 2007 (30)
    • July 2007 (49)
    • June 2007 (32)
    • May 2007 (29)
    • April 2007 (38)
    • March 2007 (26)
    • February 2007 (25)
    • January 2007 (23)
    • December 2006 (10)
    • November 2006 (12)
    • October 2006 (9)
    • September 2006 (9)
    • August 2006 (5)
    • July 2006 (13)
    • June 2006 (9)
    • May 2006 (8)
    • April 2006 (11)
    • March 2006 (12)
    • February 2006 (12)
    • January 2006 (13)
    • December 2005 (15)
    • November 2005 (19)
    • October 2005 (8)
  • Categories

    • blather (70)
    • books (10)
    • computers (179)
    • cooking (1)
    • economics (3)
    • emacs (3)
    • football (1)
    • gaming (1)
    • hiking (5)
    • housekeeping (5)
    • lifehacking (7)
    • music (3)
    • paddling (2)
    • personal (2)
    • politics (21)
    • programming (77)
    • running (266)
    • smoking (41)
    • sysadmin (13)
    • tlc (10)
    • Uncategorized (1)
  • Pages

    • Current Schedule
    • Personal Records

Copyright © 2010 nathanpowell.org
WordPress Theme based on Light Theme