wizards: Enhancements in JavaTools.java

Change-Id: Ie25b4772b34170b8ea200f1bfe6884feac49a414
Reviewed-on: https://gerrit.libreoffice.org/11049
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>