atom feed3 messages in org.codehaus.jruby.userRe: [jruby-user] dl/import on JRuby
FromSent OnAttachments
Leonardo BorgesApr 2, 2008 6:18 pm 
Antti KarantaApr 2, 2008 10:54 pm 
Leonardo BorgesApr 3, 2008 7:09 am 
Subject:Re: [jruby-user] dl/import on JRuby
From:Antti Karanta (antt@napa.fi)
Date:Apr 2, 2008 10:54:15 pm
List:org.codehaus.jruby.user

On Thu, 03 Apr 2008 04:19:20 +0300, Leonardo Borges <leon@gmail.com> wrote:

And indeed if I open jirb and type require 'dl/import', jRuby doesn't find it.

Would you have any suggestion about it? I googled it a lot but didn't find anything so far....

I would guess dl/import could be implemented into jruby using JNA (https://jna.dev.java.net/), but it seems no-ones done it, at least yet.

As a workaround, I would suggest using a conditional w/ something like if RUBY_PLATFORM == 'java' and then using JNA to access your native stuff if running on jruby. I recall that JNA home page even had some JRuby examples.

One option to using JNA is using swig (www.swig.org) to wrap your native funcs w/ Java wrappers and then calling them from jruby. This requires a separate c/c++ compilation phase for the JNI code (JNA does not require this compilation step).

.::Antti::.

--------------------------------------------------------------------- To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email