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.
47df9cfb356c3ee0523cc3571b169730?d=identicon&s=25 Kenneth McDonald (Guest)
on 2008-12-01 18: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
9ff4ad7c2fd1fc0fce18cb59f5649658?d=identicon&s=25 Peter K Chan (Guest)
on 2008-12-01 18: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
47df9cfb356c3ee0523cc3571b169730?d=identicon&s=25 Kenneth McDonald (Guest)
on 2008-12-01 19: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
9ff4ad7c2fd1fc0fce18cb59f5649658?d=identicon&s=25 Peter K Chan (Guest)
on 2008-12-01 19: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
47df9cfb356c3ee0523cc3571b169730?d=identicon&s=25 Kenneth McDonald (Guest)
on 2008-12-01 19: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.