Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
程序员文章站
2022-06-28 17:27:03
cmd运行时出现Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object出现这种结果有几种情况:C:\Program Files\Java\jdk1.8.0_161\lib目录下缺失tools.jar文件C:\Program Files\Java\jdk1.8.0_161\lib目录下缺失rt.jar文件可能系统环境变量配置了两个java.exe执行路径(一个是%JAVA_...
cmd运行时出现Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
出现这种结果有几种情况:
- C:\Program Files\Java\jdk1.8.0_161\lib目录下缺失tools.jar文件
- C:\Program Files\Java\jdk1.8.0_161\lib目录下缺失rt.jar文件
- 可能系统环境变量配置了两个java.exe执行路径(一个是%JAVA_HOME%\bin,另外一个是C:\ProgramData\Oracle\Java\javapath),注:可以去C:\ProgramData\Oracle\Java\javapath目录下查看是否有java.exe文件.
解决办法:
1.一般是有个tools.pack的包,解压成tools.jar就行
2.可以把C:\Program Files\Java\jdk1.8.0_161\jre\lib目录下的rt.jar文件copy到C:\Program Files\Java\jdk1.8.0_161\lib目录下
3.直接删除一个路径就行,建议删除环境变量path中的C:\ProgramData\Oracle\Java\javapath
另:安装了多个版本的jdk可能有冲突,也可以把你想要先执行的java.exe的路径配置到环境变量最前面.
本文地址:https://blog.csdn.net/qdm780178268/article/details/110881234
推荐阅读
-
Error occurred during initialization of boot layer | java.lang.module.ResolutionException:
-
Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
-
An internal error occurred during: "Updating Maven Project". java.lang.NullPoint
-
An internal error occurred during: "Updating Maven Project". java.lang.NullPoint
-
Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object