Now callable from java.

See test script in src/test/java.