首页 > 代码库 > 解决 java/lang/NoClassDefFoundError: java/lang/Object 错误
解决 java/lang/NoClassDefFoundError: java/lang/Object 错误
安装完JDK ,设定环境变量后出现这个错误:
[root@localhost lib]# javac
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
[root@localhost lib]# java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
解决办法:分别把
/opt/jdk1.6.0_15/lib/ tools.pack 转为 tools.jar
/opt/jdk1.6.0_15/jre/lib/rt.pack 转为 rt.jar
[root@localhost lib]# pwd
/opt/jdk1.6.0_15/lib
[root@localhost lib]# unpack200 tools.pack tools.jar
[root@localhost lib]# ls
ct.sym htmlconverter.jar jconsole.jar orb.idl tools.jar tools.pack.bak
dt.jar ir.idl jexec sa-jdi.jar tools.pack visualvm
/opt/jdk1.6.0_15/lib
[root@localhost lib]# unpack200 tools.pack tools.jar
[root@localhost lib]# ls
ct.sym htmlconverter.jar jconsole.jar orb.idl tools.jar tools.pack.bak
dt.jar ir.idl jexec sa-jdi.jar tools.pack visualvm
[root@localhost lib]# pwd
/opt/jdk1.6.0_15/jre/lib
[root@localhost lib]# unpack200 rt.pack rt.jar
/opt/jdk1.6.0_15/jre/lib
[root@localhost lib]# unpack200 rt.pack rt.jar
搞定!
解决 java/lang/NoClassDefFoundError: java/lang/Object 错误
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。