Forum: JRuby Script using Swing works from NetBeans, but not from command line. Any ideas why?

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.
Kenneth McDonald (Guest)
on 2008-12-01 19:48
(Received via mailing list)
I'm assuming I'm missing a library or something. The error output is:

file:/usr/local/jruby/lib/jruby.jar!/builtin/javasupport/proxy/
concrete.rb:6:in `new': expected [java.awt.event.ActionListener]; got:
[org.jruby.RubyProc]; error: argument type mismatch (TypeError)
         from file:/usr/local/jruby/lib/jruby.jar!/builtin/javasupport/
proxy/concrete.rb:6:in `new'
         from window.rb:28:in `initialize'
         from file:/usr/local/jruby/lib/jruby.jar!/builtin/javasupport/
proxy/concrete.rb:6:in `new'
         from file:/usr/local/jruby/lib/jruby.jar!/builtin/javasupport/
proxy/concrete.rb:6:in `new'
         from window.rb:36

Any ideas as to what is happening hear. As I say, it works fine when
run directly from netbeans, it only gives problems when I try to run
it from the command line using 'jruby'.

Thanks,
Ken

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Peter K Chan (Guest)
on 2008-12-01 19:55
(Received via mailing list)
Can you double check the version of jruby that you have on command line
to
confirm that it is the latest version?

Later versions of jruby has an automatical mapping feature to map ruby
blocks
to simple java interface (such as most listeners). It looks like your
command
line jruby may not be recent enough to have that feature.

Peter
Kenneth McDonald (Guest)
on 2008-12-01 20:10
(Received via mailing list)
MBP:Rex Ken$ jruby -v
ruby 1.8.5 (2007-06-24 rev 3841) [i386-jruby1.0]

Is this recent enough?

Thanks,
Ken


On Dec 1, 2008, at 11:53 AM, Peter K Chan wrote:

> Peter
>
>         from window.rb:36
>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Peter K Chan (Guest)
on 2008-12-01 20:21
(Received via mailing list)
Your version of JRuby is over a year old and is from the 1.0 series. I
highly
doubt that it has that feature.

Try something more recent in the 1.1 series. If I recall correctly, the
automatic mapping feature didn't come until 1.1.3 or 1.1.4. I suggest
that you
just grap 1.1.5, which is the current release.

Peter
Kenneth McDonald (Guest)
on 2008-12-01 20:53
(Received via mailing list)
Thanks!

Ken


On Dec 1, 2008, at 12:20 PM, Peter K Chan wrote:

> Peter
> ruby 1.8.5 (2007-06-24 rev 3841) [i386-jruby1.0]
>> line to
>> -----Original Message-----
>> concrete.rb:6:in `new': expected [java.awt.event.ActionListener];
>>
>>   http://xircles.codehaus.org/manage_email
>
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
This topic is locked and can not be replied to.