Java ported to new API