But build.getEnvVars is deprecated, and this is the new way. I do not know either why this can raise an Exception while the 'old' way can't.