Hello,
I have the following problem. Say I have two Java classes, Foo and Bar,
where Bar depends on Foo (it contains private static Foo foo = new
Foo();). Each of these classes (they are from the same package “p” but
that’s not important) is in a different jar (foo.jar and bar.jar). Now
I’d like to require both jars from JRuby code and then use the Bar
class, only it doesn’t seem to work. This is what happens in jirb:
irb(main):001:0> require “foo.jar”
=> true
irb(main):002:0> Java::p.Foo
=> Java::P::Foo
So far, so good.
irb(main):003:0> require “bar.jar”
=> true
irb(main):004:0> Java::p.Bar
NameError: cannot link Java class p.Bar, probable missing dependency:
p/Foo
from
/opt/jruby/lib/ruby/site_ruby/shared/builtin/javasupport/java.rb:51:in
`method_missing’
from (irb):4
How do I get Bar class aware of the Foo class? I can’t start jruby with
-classpath parameter, I need to be able to require jars dynamically from
JRuby code. Is that possible?
OndÅ™ej KuÄera
–
Cheers,
OndÅ™ej KuÄera
–
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email