Skip to content

Instantly share code, notes, and snippets.

@knzai
Created February 16, 2010 07:37
Show Gist options
  • Save knzai/305379 to your computer and use it in GitHub Desktop.
Save knzai/305379 to your computer and use it in GitHub Desktop.
Call a custom .jar from jruby
#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"
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