<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Depth-First: Running Ruby Java Bridge on Windows</title>
    <link>http://depth-first.com/articles/2006/10/12/running-ruby-java-bridge-on-windows</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Walking the Web of Chemical Informatics</description>
    <item>
      <title>Running Ruby Java Bridge on Windows</title>
      <description>&lt;p&gt;&lt;img src="http://depth-first.com/files/ruby_logo_new.gif" align="right"&gt;&lt;/img&gt;The &lt;a href="http://rjb.rubyforge.org/"&gt;Ruby Java Bridge&lt;/a&gt; (RJB) is one of the most useful Ruby integration packages available. For example, RJB enables the complete use of the Chemistry Development Kit (CDK) &lt;a href="http://depth-first.com/articles/2006/09/14/cdk-the-ruby-way"&gt;from within Ruby&lt;/a&gt;. Past articles have been written from a  unix-centric perspective. This article will show how Windows users can  join in the fun.&lt;/p&gt;

&lt;h4&gt;Prerequisites &lt;/h4&gt;

&lt;p&gt;The only software you'll need for this tutorial is &lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Sun's Java Development Kit&lt;/a&gt; (JDK).  RJB requires the JDK and won't work with Sun's Java Runtime Environment (JRE).&lt;/p&gt;

&lt;h4&gt;Install Ruby and RJB&lt;/h4&gt;

&lt;p&gt;The simplest way to get started with Ruby on Windows is to download and install the &lt;a href="http://rubyinstaller.rubyforge.org/wiki/wiki.pl"&gt;Ruby One-Click Installer&lt;/a&gt;. Be sure RubyGems support is enabled.&lt;/p&gt;

&lt;p&gt;Once Ruby is installed, RJB can then be installed by using the RubyGems packaging system (from a dos prompt - see below):&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
gem install rjb
&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Choose the most recent Win32 version (1.0.2 at the time of this writing). This will automatically compile and install RJB on your system.&lt;/p&gt;

&lt;p&gt;If you'd like, now would be a good time to also install Ruby CDK (rcdk):&lt;/p&gt;

&lt;div class="console"&gt;
&lt;pre&gt;
gem install rcdk
&lt;/pre&gt;
&lt;/div&gt;

&lt;h4&gt;Post-Install Configuration&lt;/h4&gt;

&lt;p&gt;You'll need to make sure your system's &lt;tt&gt;JAVA_HOME&lt;/tt&gt; environment variable points to your JDK installation. If you're running Windows XP, a convenient way to do so is to use Start-&gt;Control Panel-&gt;(Switch to Classic View)-&gt;System-&gt;Advanced Tab-&gt;Environment Variables. Add a new variable called &lt;tt&gt;JAVA_HOME&lt;/tt&gt; with the path to the JDK installation as a value. On my system, this path is &lt;strong&gt;C:\Program Files\Java\JDK1.5.0_09&lt;/strong&gt;. Simply installing JDK does not set your system's &lt;tt&gt;JAVA_HOME&lt;/tt&gt; environment variable.&lt;/p&gt;

&lt;h4&gt;Testing RJB&lt;/h4&gt;

&lt;p&gt;You can verify that RJB is installed and working as described in &lt;a href="http://depth-first.com/articles/2006/08/26/scripting-java-libraries-with-ruby-java-bridge"&gt;my previous article on RJB&lt;/a&gt;. A command line prompt can be obtained in Windows XP through Start-&gt;Run followed by typing &lt;strong&gt;command.com&lt;/strong&gt; and enter. The screenshot below shows RJB working via IRB:&lt;/p&gt;

&lt;p&gt;&lt;center&gt;&lt;img src="http://depth-first.com/demo/20061012/ruby_rjb.png"&gt;&lt;/img&gt;&lt;/center&gt;&lt;/p&gt;

&lt;h4&gt;Summing Up&lt;/h4&gt;

&lt;p&gt;Using Ruby and RJB on Windows is not that much different than doing so on unix. With this background, future articles will return to the theme of Ruby's role in chemical informatics software integration.&lt;/p&gt;</description>
      <pubDate>Thu, 12 Oct 2006 14:19:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:28ac1cb3-eb01-438a-8eab-e1f5661e8839</guid>
      <author>Rich Apodaca</author>
      <link>http://depth-first.com/articles/2006/10/12/running-ruby-java-bridge-on-windows</link>
      <category>Tools</category>
      <category>windows</category>
      <category>ruby</category>
      <category>rcdk</category>
      <category>rjb</category>
    </item>
  </channel>
</rss>
