在一台CentOS的虚拟机上安装了jdk之后,执行java报错,错误信息如下:
[root@node18 ~]# java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
[root@node18 ~]#
经检查环境变量设置完全正确:
[root@node18 ~]# echo $JAVA_HOME
/usr/java/jdk1.6.0_29
[root@node18 ~]# echo $PATH
/opt/apache/apache-ant-1.8.2/bin:/usr/java/jdk1.6.0_29/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
[root@node18 ~]#
根据网上的资料,进行了修复操作:
[root@node18 ~]# cd $JAVA_HOME
[root@node18 jdk1.6.0_29]# cd lib
[root@node18 lib]# ls
ct.sym dt.jar htmlconverter.jar ir.idl jconsole.jar jexec orb.idl sa-jdi.jar tools.pack visualvm
[root@node18 lib]# ls -lrt
总计 21764
-rw-r--r-- 1 root root 2406026 2011-10-03 sa-jdi.jar
-rw-r--r-- 1 root root 387784 2011-10-03 jconsole.jar
-rw-r--r-- 1 root root 429 2011-10-03 orb.idl
-rw-r--r-- 1 root root 18380 2011-10-03 ir.idl
-rw-r--r-- 1 root root 15678909 2011-10-03 ct.sym
-rw-r--r-- 1 root root 145442 2011-10-03 dt.jar
-rw-r--r-- 1 root root 215294 2011-10-03 htmlconverter.jar
-rw-r--r-- 1 root root 3323731 2011-10-04 tools.pack
-rwxr-xr-x 1 root root 7056 2011-10-04 jexec
drwxr-xr-x 6 root root 4096 2011-12-05 visualvm
[root@node18 lib]# unpack200 tools.pack tools.jar
[root@node18 lib]#
[root@node18 lib]#
[root@node18 lib]# java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
[root@node18 lib]#
[root@node18 lib]#
[root@node18 lib]# cd ../jre/lib/
[root@node18 lib]#
[root@node18 lib]# unpack200 rt.pack rt.jar
[root@node18 lib]#
[root@node18 lib]#
[root@node18 lib]# java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode)
[root@node18 lib]#
很纳闷,为什么在安装jdk的时候会有问题的,连 tools.jar 和 rt.jar 这么重要的文件都没有呢?
参考资料:
http://frankzhao.blog.51cto.com/273790/244586/
PS:后来发现这个解决方法治标不治本,其他的程序无法起来,比如tomcat,最后只好重新安装jdk才解决。
分享到:
相关推荐
Error occurred during initialization of VM agent library failed to init: instrument 网上给出了非常丰富的解决方案,但看到很多人可能对命令行不是很熟悉,不知道该如何准确找到.vmoptions文件,这篇博客给出...
1、通过java调用Python命令执行datax任务调度 2、自动开始任务和调度结束关闭...3、如果我们在cmd使用命令调度,执行完毕后无法释放内存,会造成内存泄露不足,出现报错“Error occurred during initialization of VM”
内存溢出是指程序运行时,申请的内存超过了系统所能分配的最大内存空间,导致程序无法继续执行的现象。在Java中,内存溢出主要分为两类:堆溢出(Heap OutOfMemoryError)和永久代溢出(Permanent Generation ...
本文将深入探讨如何解决PyCharm安装时出现的编码错误问题,确保软件的正常运行。 ### PyCharm安装中的编码错误 PyCharm在安装过程中可能会遇到编码错误,尤其是当系统环境设置不当或存在非标准字符集的情况下。...
Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object 这是因为Java目录\lib或Java目录\jre\lib下缺少rt.jar或者有一个rt.pack,(把rt.pack删除掉,然后)下载本文件至...
# Error occurred during initialization of VM # java/lang/NoClassDefFoundError: java/lang/Object cd jdk1.6.0_191/lib ../bin/unpack200 tools.pack tools.jar cd jdk1.6.0_191/jre/lib ../bin/unpack200 rt....
1.在安装目录bin下找到idea.bat 并在最后一行添加pause 2.执行idea.bat ...Error occurred during initialization of VM Initial heap size set to a larger value than the maximum heap size 解决
6. **内存分配问题**:另一个常见的错误是“Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap”。这意味着JVM在启动时无法分配足够的内存。你可以通过修改`...
在 Tomcat 启动时,提示:“Error occurred during initialization of VM Could not reserve enough space for object heap”。该错误是因为 Tomcat 的 bin 目录下,catalina.sh 文件的 Tomcat 内存参数配置过大,...
本文主要介绍AndroidStudio 使用过程中出现的异常的解决办法,这里帮大家举例说明,如何处理出现这种问题,有需要的小伙伴可以参考下
在打包过程中可能会遇到问题,如描述中提到的错误日志:“Error occurred during initialization of VM...Could not reserve enough space for 1048576KB object heap”。这个错误表明Java虚拟机(JVM)在启动时无法...
Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit...
Error occurred during initialization of VM Could not reserve enough space for object heap Unable to create JVM. ``` 这表明在初始化Java虚拟机时发生了错误,具体原因是无法为对象堆分配足够的内存空间。这...
**问题描述**:启动Eclipse时提示“Failed to create the Java Virtual Machine”或“Error occurred during initialization of VM”。 **解决方案**: - **增加内存分配**:打开Eclipse的启动脚本(在Windows系统...
**问题描述**:启动时出现“Error occurred during initialization of VM”这样的错误。 **解决方法**:重启计算机通常可以解决此类问题。此外,检查JDK的安装路径是否包含空格或特殊字符,有时这也可能导致类似错误...
错误提示为:“Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap”。这个错误通常是因为JVM(Java虚拟机)的默认内存配置太小,无法满足构建过程的内存需求。...
Error occurred during initialization of VM Unable to load native library: /tmp/OraInstall2009-01-07_12-33-13PM/jre/lib/i386/libjava.so: symbol __libc_wait, version GLIBC_2.0 not defined in file libc....
[3085140] Ia_arpl_Ew_Rw definition of error [3078995] ROL/ROR/SHL/SHR modeling wrong when dest reg is 32 bit [2864794] BX_INSTR_OPCODE in "cpu_loop" causes crash in x86_64 host [2884071] [AIX host...