Forum: Ruby JRuby and eclipse plugin

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6cc7fa7c4bc582a4886a8134f2f1f8fc?d=identicon&s=25 Ahmed Abdelsalam (amabdelsalam)
on 2009-04-24 08:27
Hi,...

I have a problem with running a ruby script from inside eclipse plugin.
Simply, I created a ruby a script that calls some java functions from
class inside eclipse plugin. the problem is that the script cannot load
such java plugin, it gives me the following error:

Here is the ruby code:
class Cells < Java::cz.cesnet.meta.jruby.Cells
  def initialize
    @cells = {'a1' => 'Hello a1'};
  end
end

The error:
javax.script.ScriptException: org.jruby.exceptions.RaiseException:
cannot load Java class cz.cesnet.meta.jruby.Cells
    at
com.sun.script.jruby.JRubyScriptEngine.evalNode(JRubyScriptEngine.java:456)
    at
com.sun.script.jruby.JRubyScriptEngine.eval(JRubyScriptEngine.java:186)
    at javax.script.AbstractScriptEngine.eval(Unknown Source)
......

    at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Caused by: org.jruby.exceptions.RaiseException: cannot load Java class
cz.cesnet.meta.jruby.Cells
    at (unknown).(unknown)(/builtin/java/ast.rb:49)
    at
(unknown).get_proxy_or_package_under_package(/builtin/javasupport/java.rb:51)
    at #<Class:01x661532>.method_missing(<unknown>:1)
    at (unknown).(unknown)(:1)

The strange point is that when removing <
Java::cz.cesnet.meta.jruby.Cells from the above code, the eclipse plugin
gives no errors, I can even add the command
Java::JavaLang::System.out.println("wwwww") and it works. Which means it
can see standard java classes not classes in my eclipse plugin project.

I'm using JRuby 1.2, eclipse 3.3.2

Can anyone help me?

Thanks


Ahmed
This topic is locked and can not be replied to.