Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
By adding Jar file into the Jruby project.Can We use a java classes of the that Jar file into the Jruby?
是的你可以。我有一个在 java 上构建 GUI 的项目(使用 NetBeans),其余的我在 ruby、控制器等中完成。我只需要将变量(方法)声明为 public 即可访问它们(如果可以的话,我不是 100% shure避免这种情况)。您可以在 Ruby 中创建一个带有别名的部分,使它们看起来像 ruby 语法。请注意,您还必须在 Ruby 代码中要求该 jar。