java: do not fail set environment with null

Change-Id: Icda678d448bcf4d241782e08b2e6c067da3b4790
Signed-off-by: Alon Bar-Lev <alonbl@redhat.com>