Re: [JRuby] - Unable to call java method from different directory

Hi All ,

I have moved the Java file into “Lib” director and tried to call that
java
from jruby ( separating java file in to separarte form Jruby code ) but
its giving below error

*// JRuby Code *
mselv2m1:ruby_Code mselv2$ cat Lib.rb
import ‘/Lib/Hi’
Java::Hi.SayHello()
#puts a
*// Java program in Lib folder *
mselv2m1:ruby_Code mselv2$ cd Lib
mselv2m1:Lib mselv2$ ls
Hi.java

// ERROR :
*
*
mselv2m1:ruby_Code mselv2$ jruby Lib.rb
NameError: cannot load Java class /Lib/Hi
for_name at org/jruby/javasupport/JavaClass.java:1242
get_proxy_class at org/jruby/javasupport/JavaUtilities.java:34
java_import at
file:/usr/local/jruby-1.7.4/lib/jruby.jar!/jruby/java/core_ext/object.rb:26
map at org/jruby/RubyArray.java:2417
java_import at
file:/usr/local/jruby-1.7.4/lib/jruby.jar!/jruby/java/core_ext/object.rb:22
(root) at Lib.rb:1
mselv2m1:ruby_Code mselv2$ pwd

Should i do any more modification when calling java from separate
directory

Thanks ,
Muthu S. SR