Communication java/javascript