[issue #45] Better java integration