Have you tried include_class ‘java.lang.*’? I remember reading that this is
supported somewhere.
Unless someone added ‘*’ to include_class this is the only code I know
to do this:
module Foo
include_package ‘java.lang’
end
Foo::System.getProperty(“ick”)
We have talked about collaborating with Jython on providing the right
magic to be able to nicely include packages (there is no standard API
for this in Java), but we not crossed that bridge yet.
One historical issue which keeps getting smaller is loading n classes
of a package takes time (much much much less than in the past). One
could argue that we could do that lazily, but then we need
const_missing hook (or equiv). It ends up having some unexpected
complexity.
A second issue is that we can dynamically alter a package by
dynamically including more classes into the runtime at any point in
time. Note, that this a bigger burden than languages which can
compile and resolve packages at load time/compile time.
These are not insurmountable, but not trivial either. We also have
never had anyone hack in a patch for us to play with. Perhaps we will
talk to the Jython guys this month at PyCon and see what we can do…