Added java env var exports and some sanity check before exports