[ https://issues.apache.org/jira/browse/HADOOP-10018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13786510#comment-13786510 ]
Haohui Mai commented on HADOOP-10018: ------------------------------------- I believe that the Shell class will need a valid directory in order to ensure that getcwd() succeeds. That's the reason why hadoop.home.dir needs to be set to a valid path. it might not be a good idea to depend on java properties or environment variables. For example, using the environment variable HADOOP_HOME causes this bug. Similar issues might arise for properties like user.home -- I'm unfamiliar with the partsof JDK specifications that specify that user.home has to be a valid path (in fact it might not be, due to bugs in JDK: http://stackoverflow.com/questions/2134338/java-user-home-is-being-set-to-userprofile-and-not-being-resolved). Notice that simply setting it to "/" won't work either due to Windows compatibility. I agree that setting to a temporary directory is imperfect, but compared to alternative approaches it seems this one is slightly more robust and more platform neutral. > TestUserGroupInformation throws NPE when HADOOP_HOME is not set > --------------------------------------------------------------- > > Key: HADOOP-10018 > URL: https://issues.apache.org/jira/browse/HADOOP-10018 > Project: Hadoop Common > Issue Type: Bug > Reporter: Haohui Mai > Assignee: Haohui Mai > Priority: Minor > Attachments: HADOOP-10018.000.patch > > > TestUserGroupInformation throws NPE in System.setProperty() when HADOOP_HOME > is not set. -- This message was sent by Atlassian JIRA (v6.1#6144)