In java you can do something like this, to include all packages under java namespace.
import java.*;
At https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby They suggest using include_package
or import
. I also tried java_package
and java_import
. Is there a way to import like this or do you just require the pacakges that you need.
require 'java'
module JavaUtil
include_package "java.util"
end
JavaUtil::Date.new
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.