Java_send for static methods

I am using JWNL for getting Wordnet to JRuby.
JWNL has a main class with a static method called “initialize”, which
clashes with Ruby’s initialize.

java_send or java_method (using JRuby 1.4) does not work,

undefined method `java_send’ for Java::NetDidionJwnl::JWNL:Class (NoMethodError)

neither does java_alias:

Jwnl = JavaUtilities.get_proxy_class(‘net.didion.jwnl.JWNL’)
class Jwnl; java_alias :jinitialize, :initialize; end

in `java_alias’: java method not found: net.didion.jwnl.JWNL.initialize()
(the static initialize is also 1-ary)

According to, calling
static methods is not implemented:

This works for all instance methods. I have not implemented it for
static methods…does it seem like I should?

Is there any other way to calling a static method on a Java class?


have you tried a newer version of jruby?

I found that the error message changed, from

(1.4): undefined method `java_send’ for Java::NetDidionJwnl::JWNL:Class


(1.6.1): NameError: Java method not found:

So I made the call with the formal signature type (InputStream) instead
of the actual type (FileInputStream) which works:

f =’~/tools/jwnl/config/file_properties.xml’)
JWNL::Jwnl.java_send( :initialize, [], f )

Thanks for making me look again, Robert.

I am also trying JAWS (SWAJ, only backwards :wink: now, which still has
global initialization (via java.lang.System.setProperty), but doesn’t
need a separate XML-file for configuration.


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs