Invoking Java classes from JRuby seemed like such
a simple thing to do. This page tells you exactly
how to write the code, and it says to put the
external jars in the CLASSPATH variable, or in
RUBY_HOME/lib, or by requiring it and having it
in the Ruby load path:
http://www.headius.com/jrubywiki/index.php/Calling_Java_from_JRuby
But I'm working in NetBeans. So:
* The jruby directories could get overwritten at
any time, when I download a new version. So I
don't want to put them there.
* Under the Project Properties -> Java, there is a nice
little Ruby Classpath setting. But I get the error:
"cannot load Java class (name error)".
(I've inspected the class path and name a dozen times,
copied it in from the Javadoc to be sure there were no
spelling errors, and verified that they match the path
and name in the jar.)
* I'll be happy to require the jar files in the code.
(I'd rather do it there, actually) but I don't know
what the Ruby load path is in NetBeans, and I don't
see any way to affect it.
Note:
I'm running 6.0 M10, with all the trimmings, for the
sake of its Ruby support. Any other NB hackers out there
who can lend an assist?
(I'm posting there, too. But I unsubscribed from it quite
a while ago and don't if I'll see an answer.)
--
Eric Armstrong, Document Systems Architect, Sun Microsystems
http://blogs.sun.com/coolstuff
http://www.artima.com/weblogs/index.jsp?blogger=cooltools
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email