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
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’
#puts a
*// Java program in Lib folder *
mselv2m1:ruby_Code mselv2$ cd Lib
mselv2m1:Lib mselv2$ ls

// ERROR :
mselv2m1:ruby_Code mselv2$ jruby Lib.rb
NameError: cannot load Java class /Lib/Hi
for_name at org/jruby/javasupport/
get_proxy_class at org/jruby/javasupport/
java_import at
map at org/jruby/
java_import at
(root) at Lib.rb:1
mselv2m1:ruby_Code mselv2$ pwd

Should i do any more modification when calling java from separate

Thanks ,
Muthu S. SR