use java directly