Hi,
Please note that I’ve a specific setup (available at
https://github.com/cmichon/jruby) and I already know for sure that
what I’m going to report works in standard jruby.
I’m trying to speed up some mathematical calculations through java
code. Since I felt that java extensions (all the way) seemed hard, I
found a simple example to try out my minimal expectations:
And this is giving me problems… I hope an expert of java+jruby
internals could help me out here
1/ I compile the following Hi.java file and make it a jar file Hi.jar:
class Hi {
public Hi() {
}
void f() {
System.out.println(“hi”);
}
}
2/ I try the following hi.rb script using jruby-jars approach:
require ‘java’
include_class Java::Hi
Hi.new.f
=> it should say ‘hi’
3/ launching “java -cp
jruby-core-1.6.0.RC2.jar;jruby-stdlib-1.6.0.RC2.jar;Hi.jar
org.jruby.Main hi.rb”, I get the following error
hi.rb:3:in (root)': undefined method
f’ for #Java::Hi:0x932fe
(NoMethodError)
This works with standard expanded jruby setup, but not with a
jruby-jars approach…
Am I missing some lines, tweaks or switches to make this works out of
the box ?
Thanks in advance for any pointers.
–
Christian