Now you can bring the best of Ruby into the world of Java, with Using JRuby. Come to the source for the JRuby core team’s insights and insider tips. You’ll learn how to call Java objects seamlessly from Ruby, and deal with Java idioms such as interfaces and overloaded functions. Run Ruby code from Java, and make a Java program scriptable in Ruby. See how to compile Ruby into .class files that are callable from Java, Scala, Clojure, or any other JVM language.

Paperback list price normally $34.95, now on sale for $9.95 while supplies last.

Out of Print

This book is currently out of print.

About this Book

  • 300 pages
  • Published:
  • Release: P1.0 (2011-01-26)
  • ISBN: 978-1-93435-665-4

In Using JRuby you’ll venture into the wide world of open-source Ruby and Java libraries. Write Ruby on Rails web applications that run on Java servers like Tomcat. Use Java’s JDBC or Hibernate to easily connect Ruby to industry-standard databases. Test your Java program using Ruby’s elegant Cucumber and RSpec frameworks. Create dazzling desktop user interfaces with frameworks like Limelight and Monkeybars. Package a Rails or plain Ruby project for easy deployment to any Java environment.

JRuby lets you merge the best of several possible worlds, so you can create unique software using the best tools available. This book is your definitive guide.

What You Need

JRuby 1.7.4

Contents and Extracts

Full Table of Contents

  • JRuby Core
    • Getting to Know JRuby
    • Driving Java from Ruby excerpt
    • Ruby from Java: Embedding JRuby excerpt
    • The JRuby Compiler
  • JRuby and the World
    • Introduction to Rails excerpt
    • JRuby and Relational Databases
    • Building Software for Deployment
    • Testing Your Code with JRuby
    • Beyond Unit Tests
    • Building GUIs with Swing
  • Reference
    • Ruby 101
    • Ruby/Java Interoperability
    • Configuring JRuby
    • Calling External C Code
    • JRuby for Sysadmins
    • Limelight Example Source
    • Bibliography

About the Author

Charles Nutter and Thomas Enebo co-lead the JRuby project.

Nick Sieger is a core contributor to JRuby and many other libraries.

Ola Bini writes software at ThoughtWorks.

Ian Dees is the author of Scripted GUI Testing With Ruby.

Upcoming Author Events

  • 2013-06-19: Ian Dees
    How My Kids Are Learning to Program By Talking, a discussion of how storytelling relates to novice programmers (Open Source Bridge, Portland)
  • 2013-07-24: Ian Dees
    Planned Obsolescence: Built to Last, or Build One to Throw Away?, in which we talk about how to avoid over-engineering and still write code we can maintain (OSCON, Portland)
  • 2013-09-17: Ian Dees
    Testing Embedded Systems With Cucumber, in which we see that Cucumber isn't just for Web apps. (CukeUp NYC)
  • 2013-09-17: Ian Dees
    Elixir, Erlang, and Cucumberl, a fun journey into testing Elixir code from Cucumber (CukeUp NYC)

Comments and Reviews

  • This book is an excellent resource for JRuby and will without a doubt facilitate JRuby adoption in Java-centric enterprises.

    —Bharat Ruparel Senior information architect America's Test Kitchen
  • This book makes a compelling case for JRuby. A must-have to bring some Ruby goodness to your Java powerhouse.

    —Fred Daoud Author, "Stripes...and Java Web Development Is Fun Again," and "Getting Started with Apache Click"
  • This is one of those books that you don’t want to put down and you can’t wait to get back to. For a technical publication, that is extremely rare. After reading this book, I can say I have a very good understanding of what JRuby is, how it interacts with Java, and a working knowledge of many of the supporting tools to accomplish a wide range of tasks. The way this book is organized, it makes a great reference for future development.

    —Gale Straney Senior software design engineer Tektronix
  • This book will open the eyes of any Java programmer who wants to take their art to the next level. Read it.

    —Geoff Drake Owner Managed Design
  • I really liked the clear structure of the book and all the covered libraries/dependencies (like Rake, Ant, Maven, testing frameworks). This clearly outlines the whole JRuby universe so that new users will immediately see what’s available and how to start using it.

    —Vladimir Sizikov Senior Engineer Oracle
  • My JRuby apps will go live in two weeks. Without your book and the Ruby community, I would never have gotten this far.

    —Pinit Asavanuchit Intersol Consulting Co., Ltd.
  • I was floored by the amount of technical detail the authors managed to cram in here! And they did it with such an approachable and readable tone that this book was both easy and fun to read. I can’t remember the last technical book that did that for me. The breadth of coverage is astounding, too.

    —Kent R. Spillner
  • I was very happy to discover the JRuby project, my favorite programming language running on what’s probably the best virtual machine in the world. This book really covers every in and out of this fantastic project.

    —Peter Lind Technical Consultant Valtech