Skip to content

Instantly share code, notes, and snippets.

@headius
Created March 11, 2015 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/a950a5ed61455fd4f748 to your computer and use it in GitHub Desktop.
Save headius/a950a5ed61455fd4f748 to your computer and use it in GitHub Desktop.
[] ~/projects/jruby $ jirb
irb(main):001:0> java.lang.System.get_property(1)
NameError: no method 'getProperty' for arguments (org.jruby.RubyFixnum) on Java::JavaLang::System
from (irb):1:in `<eval>'
from org/jruby/RubyKernel.java:1005:in `eval'
from org/jruby/RubyKernel.java:1315:in `loop'
from org/jruby/RubyKernel.java:1125:in `catch'
from org/jruby/RubyKernel.java:1125:in `catch'
from /Users/headius/projects/jruby/bin/jirb:13:in `<top>'
irb(main):002:0> JavaUtilities.register_converter Fixnum, java.lang.String, proc {|f| f.to_s.to_java}
=> nil
irb(main):003:0> java.lang.System.set_property(1, "one")
=> nil
irb(main):004:0> java.lang.System.get_property(1)
=> "one"
irb(main):005:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment