配置tomcat时遇到的jdk没有解压完全的问题
今天下午在RedHat linux enterprise5.4上安装tomcat。
最后执行/usr/tomcat/bin/startup.sh启动的时候报,Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
java/lang/NoClassDefFoundError: java/lang/Object
在网上寻找到原因为: /usr/lib/jdk1.6.0_17/lib下面的tools.pack需要解压为tools.jar,/usr/lib/jdk1.6.0_17 /jre/下的rt.pack需要解压为rt.jar。不过还好在/usr/lib/jdk1.6.0_17/bin下有一个工具unpack200可以解压。不明白sun为什么搞成这么麻烦?
网上找的文章贴在下面。
======================================================================
安装完JDK ,设定环境变量后出现这个错误:
[root@localhost lib]# javac
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
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