I am trying to create an hybrid between a JRuby and a Java application, so that it may be possible to migrate single components at a time. What I am trying to do right now is really simple, here is the Ruby class: require 'java'
java_package 'eu.netprophecy.test'
class RubyViewModel
java_signature 'String getGreeting()'
def getGreeting
puts "Hello, ZK, from Ruby!"
end
end
I want to be able to use this View Model from a ZK project:
<?page title="Hello, Ruby!" contentType="text/html;charset=UTF-8"?>
<zk>
<window title="Hello Ruby!!" border="normal" width="200px" apply="org.zkoss.bind.BindComposer"
viewModel="@id('vm') @init('eu.netprophecy.test.RubyViewModel')">
<label value="@load(vm.greeting)"/>
</window>
</zk>
I tried creating a jar with marbler
, but it places the .class file with the java bytecode in a directory with the project name in front, messing with the expected package structure (in this case I get EJB/eu/netprophecy/test/RubyViewModel, which means I am unable to use the generated Java class in the Java code).
Does anyone know if this is at all possible, if there are better ways to do it,, or if I have to create manually the jar?