I can't seem to find what the current syntax for using java classes in Jruby is. This link text article lists:
include Java
include 'java'
require 'java'
As valid options, though it says the last option is pre 1.0 and doesn't work.
The Jruby Wiki however says to use require 'java'
And for including classes I've seen
MyClass = Java::some.package.MyClass
include_class Java::some.package.MyClass
include_class 'some.package.MyClass'
java_import Java::some.package.MyClass
Is there one preferred method?
Currently I'm getting some "redefining X" message as I have a few java classes named the same as my ruby class. What's the best method for keeping the java namespace so I don't get these, and are there any issues (aside from the obvious Java class taking precedent to the ruby class) with this redefinition if I never use the two ruby/java classes in the same file?