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

02ee2ff9234924331adcb4845754e75e?d=identicon&s=25 Muthu Selvan SR (Guest)
on 2013-06-28 00:47
(Received via mailing list)
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 Selvan SR
This topic is locked and can not be replied to.