Adjusted to be able to use java environment variables in certain environments