JRuby: import vs include vs java_import vs include_class

后端 未结 2 673
日久生厌
日久生厌 2020-12-28 14:44

why so many different ways to include Java classes into JRuby? What are the differences? Which one should I use?

2条回答
  •  [愿得一人]
    2020-12-28 15:04

    import doesn't play well with Rake, so it's discouraged. java_import is the newest, and recommended. include_class has been deprecated. Apart from that they all do the same thing, and are actually aliases of each other.

    import is an alias for java_import and java_import calls include_class.

提交回复
热议问题