Created
March 22, 2010 00:05
-
-
Save MarkMenard/339670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mark@Marks-MacBook-2:tmp/jrubyc-test]$ cat foo.rb | |
require 'java' | |
java_require 'foo' | |
class Foo | |
java_signature 'void main(String[])' | |
def self.main(args) | |
bar(args[0], args[1]) | |
end | |
java_signature 'void bar(int, int)' | |
def self.bar(a,b) | |
puts a.to_i + b.to_i | |
end | |
end | |
[mark@Marks-MacBook-2:tmp/jrubyc-test]$ java -cp /Users/mark/tmp/jruby-1.5.0.dev/lib/jruby.jar:. Foo 1 2 | |
Exception in thread "main" java.lang.ExceptionInInitializerError | |
Caused by: org.jruby.exceptions.RaiseException: use `java_import' to load normal Java classes | |
at (unknown).new(:1) | |
at (unknown).(unknown)(:1) | |
[mark@Marks-MacBook-2:tmp/jrubyc-test]$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment