Moved the java env objects statically so that it can be used in other places