using java mainline