require('find-java-home')(function(err, home){
  if(err){
    console.error("[node-java] "+err);
    process.exit(1);
  }
  process.stdout.write(home);
});

require('find-java-home')(function(err, home){
  if (err || !home) {
    if (!err) err = Error('Unable to determine Java home location');
    process.exit(1);
  }
  process.stdout.write(home);
});

Exit with error if Java home can't be found
Exit with error if Java home can't be found
