it would add also 
if (home==null){
 home = System.getProperty("java.home") 
}
and then rest of the logic