Error occurred during initialization of VM java.lang.Error: Properties init: Could not determine current working directory.

在执行hdfs namenode -format时

报错

Error occurred during initialization of VM
java.lang.Error: Properties init: Could not determine current working directory.
at java.lang.System.initProperties(Native Method)
at java.lang.System.initializeSystemClass(System.java:1166)

这个错误大概有两种情况:

1、JDK安装之后配置环境变量有问题

2、当前目录不可用

 

我查看了一下  /etc/profile   里配置的JAVA_HOME环境变量,没有错误

于是我退出当前目录,重新执行了hdfs namenode -format,执行成功

 

原因说明:

当前目录被删除过,那么在此目录下执行shell命令就会报错

退出当前目录即可解决

 

posted @ 2018-01-12 21:35  anmofree  阅读(1777)  评论(0编辑  收藏  举报