提交 8626f087 编写于 作者: L lbw

增加运行环境判断,避免nacos-server 在windows 中文路径运行环境初始化失败问题

上级 62d034ab
...@@ -45,10 +45,10 @@ public class PigNacosApplication { ...@@ -45,10 +45,10 @@ public class PigNacosApplication {
*/ */
private static boolean initEnv() { private static boolean initEnv() {
// 特殊处理 window 且用户名包含中文的用户,避免RocksDB 初始化失败 // 特殊处理 window 且用户名包含中文的用户,避免RocksDB 初始化失败
// System.setProperty(SystemUtil.USER_HOME, "/nacos-path/");
if (SystemUtil.getOsInfo().isWindows() if (SystemUtil.getOsInfo().isWindows()
&& Validator.hasChinese(SystemUtil.getUserInfo().getName())) { && Validator.hasChinese(SystemUtil.getUserInfo().getHomeDir())) {
log.error("路径包含中文,需要在以下配置指定不包含中文目录"); log.error("路径包含中文,需要打开以上注释配置指定不包含中文目录");
System.setProperty(SystemUtil.USER_HOME, "/nacos-path/");
return false; return false;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册