[英]jdk-14.0.1 Error occurred during initialization of VM java.lang.NullPointerException
I installed jdk-14.0.1 in my computer and I set Environment variable for that, when I give command java
or java -version
it gives below exception.我在我的计算机中安装了 jdk-14.0.1 并为此设置了环境变量,当我发出命令java
或java -version
时,它给出了以下异常。
Error occurred during initialization of VM
java.lang.NullPointerException
at java.lang.System.getProperty(java.base/System.java:850)
at sun.security.action.GetPropertyAction.privilegedGetProperty(java.base/GetPropertyAction.java:105)
at java.nio.charset.Charset.defaultCharset(java.base/Charset.java:605)
at java.lang.StringCoding.decode(java.base/StringCoding.java:329)
at java.lang.String.<init>(java.base/String.java:610)
at java.lang.String.<init>(java.base/String.java:632)
at jdk.internal.util.SystemProps$Raw.vmProperties(java.base/Native Method)
at jdk.internal.util.SystemProps$Raw.cmdProperties(java.base/SystemProps.java:253)
at jdk.internal.util.SystemProps.initProperties(java.base/SystemProps.java:55)
at java.lang.System.initPhase1(java.base/System.java:2002)
my system configuration is like-我的系统配置就像-
This can* happen if you have the default locale to Codepage 65001 - UTF-8.如果您将默认语言环境设置为代码页 65001 - UTF-8,则可能会发生这种情况。
To "fix" this on Windows 10:要在 Windows 10 上“修复”此问题:
* It should not, however. * 但是,它不应该。
For those whoes code page is not 65001 but come acorss the same problem.对于那些代码页不是 65001 但遇到同样问题的人。 Suggest try openjdk 14. It works for me.建议尝试 openjdk 14。它对我有用。
Solution for windows 10: windows 10 的解决方案:
Open command prompt(CMD)打开命令提示符(CMD)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.