Windows PowerShell里面使用-Dfile.encoding=UTF-8时报Error: Could not find or load main class错误

java -Dfile.encoding=UTF-8 -cp . T这条命令在cmd窗口正常运行,PowerShell里面报错,需要改成java -D"file.encoding"=UTF-8 -cp . T-D里面的属性包含了.需要用引号(单引号双引号都行)包裹起来。
cmd中:
在这里插入图片描述
PowerShell中:
在这里插入图片描述

posted @ 2024-12-24 11:04  西瓜当冬瓜  阅读(7)  评论(0)    收藏  举报  来源