no, it’s not obvious at all. Basically, what require does is put the jar
on
the classpath, import/java_import makes the imported class available
under
its constant name. otherwise, you can access it via its fully qualified
name, with all the package information included. So either:
require ‘blah/blah/blah.jar’
java_import ‘org.blah.BlahClass’
class BlahClass# your codeend
or
require 'blah/blah/blah.jar’require ‘java’
BlahClass = org.blah.BlahClass
class BlahClass# codeend
At least, that’s my understanding of how it works.
I think that this reading must be useful for this question.
But I think that make two sides one for Java and another for Ruby its a
good practice because you can always
use Jars on Java way on other stages of development like deployments…
using Ruby way to give Java libraries
on your code could give you a late head hache when you try to put all
together.