ERROR: JAVA_HOME is set to an invalid directory: **\jdk1.8\jdk 1.8.0_05

来源:互联网 发布:水浒传媒 优化方案 编辑:程序博客网 时间:2024/05/04 03:14
ERROR: JAVA_HOME is set to an invalid directory: D:\**\soft\jdk1.8\jdkPlease set the JAVA_HOME variable in your environment to match thelocation of your Java installation.Please set the JAVA_HOME variable in your environment to match thelocation of your Java installation.

在Windows下的cmd窗口中运行grails RunApp命令,但是报错了,错误如上,而且在开发工具中是可以正常启动的,找了很多原因都不对,最后都重新装系统了,后来发现了问题:在cmd的编码会影响命令行的运行,默认情况下cmd的编码是gbk,我改成了utf-8,才导致了这个问题,真的是太纠结了,下次引以为戒吧!附改cmd编码的命令:


chcp 查看当前编码
chcp 65001 就是换成UTF-8代码页,还需要点击边框右键-属性-字体-改为Lucida Console
chcp 936 可以换回默认的GBK
chcp 437 是美国英语

阅读全文
0 0