java: Could not determine current working directory.

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)

复现场景
macOS,命令行pwd位于target目录;
maven 重新打包后,target被重新创建。
这时候,命令行pwd位于的target目录,与新创建的target并不是同一个目录。

命令行退出当前目录,重新进入新的target即可
cd .. && cd target

你可能感兴趣的:(java: Could not determine current working directory.)