JRuby Bridge Tutorial - Download the Example

DOWNLOAD
The file jr8example.zip contains the example files, which I used to work out the details of this tutorial. Unzip it into an empty directory.

For Windows, jr8.bat runs the example, but before you to this, edit, if necessary, the line

set JRUBY_JAR=c:\dl\jruby-complete-1.7.23.jar

in jr8.bat to wherever your JRuby-Complete file is located. To compile and run it with two separate jar files, simply execute

jr8

To compile and run it with one combined jar file, execute

jr8 Y C

Running the application will cause all kind of (mostly nonsense) text to be written to the standard output, the only purpose of this being that you can relate the produced text to the corresponding places in the program. By the way: If you run it in a Windows command console - which you most likely will -, the batch file sets the codepage to 1252 and some characters - those which are not defined in this codepage - are displayed as question marks in the standard output. This is not a bug, but expected behaviour.

The example also creates a file ucout.txt, which contains a short UTF-8 encoded text. If you look at the text with your editor and can't read it, even though you have set your editor to UTF-8, it means that the editor font doesn't contain these characters. I usually set my text editor font to MS Mincho to ensure that these characters are displayed correctly, but be aware that, for historical reasons, MS Mincho displays the backslash (\) as !