update+improve Java lib