Skip to content

arton/rjb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c84a4ea · May 1, 2024
Jan 9, 2008
May 1, 2024
May 1, 2024
Nov 22, 2010
May 1, 2024
Oct 29, 2016
Aug 3, 2006
May 1, 2024
Mar 1, 2023
Oct 28, 2016
Sep 19, 2014
Oct 29, 2016
Mar 1, 2023
Aug 1, 2020
Aug 1, 2020
Apr 24, 2024

Repository files navigation

Rjb is Ruby-Java bridge using Java Native Interface.

The Ruby Kaigi 2010 Presentation on Rjb.

A short introduction in English.

Some examples in Japanese, but the source code is clear for everybody.

How to install

You need to install Java2 sdk, and setup JAVA_HOME enviromental varible except for OS X. I assume that OS X's JAVA_HOME is reported by calling /usr/libexec/java_home.

This done please proceed with:

ruby setup.rb config
ruby setup.rb setup
# (in Unix)
sudo ruby setup.rb install

or

# (in win32)
ruby setup.rb install

How to test

On Windows based machines:

cd test
ruby test.rb

On Unix based machines plese see test/readme.unix. You need to set LD_LIBRARY_PATH environmental variable to run rjb.

Notice for opening non-ASCII 7bit filename

If you'll plan to open the non-ascii character named file by Java class through Rjb, it may require to set LC_ALL environment variable in your script.

For example in Rails, set above line in production.rb as your environment:

ENV['LC_ALL'] = 'en_us.utf8' # or ja_JP.utf8 etc.

cf: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4733494 (Thanks Paul for this information).

Contact

[email protected]