Skip to content

Instantly share code, notes, and snippets.

@vishnugopal
Created May 26, 2009 16:53
Show Gist options
  • Save vishnugopal/118162 to your computer and use it in GitHub Desktop.
Save vishnugopal/118162 to your computer and use it in GitHub Desktop.
def import
puts "a"
end
require 'java'
import java.lang.System
puts "Worked!"
----
vishnu@Elena ~/Code/Sandbox/test% jruby test.rb
Worked!
vishnu@Elena ~/Code/Sandbox/test% ruby test.rb
test.rb:6:in `require': no such file to load -- java (LoadError)
from test.rb:6
zsh: exit 1 ruby test.rb
vishnu@Elena ~/Code/Sandbox/test% touch "java.rb"
vishnu@Elena ~/Code/Sandbox/test% ruby test.rb
test.rb:7: undefined local variable or method `java' for main:Object (NameError)
zsh: exit 1 ruby test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment