Created
February 16, 2010 07:37
-
-
Save knzai/305379 to your computer and use it in GitHub Desktop.
Call a custom .jar from jruby
This file contains hidden or 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
#javac HelloWorld.java && jar cvf HelloWorld.jar HelloWorld.class | |
require 'java' | |
require 'HelloWorld.jar' | |
import 'HelloWorld' | |
puts HelloWorld.new.hello | |
#jruby hello_world.rb | |
#=> "Hello cruel world" |
This file contains hidden or 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
public class HelloWorld { | |
public String hello() { | |
return "Hello cruel world"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment