Added Java port.