When you run java/javac/java -version under the doc command, an error was reported:
Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
Or eclipse cannot be opened for this reason
I summarized the following three reasons:
1: java environment variables are misconfigured, check the right and wrong environment variables, especially check the classpath
General (in the case of java configuration only), the value of the environment variable
JAVA_HOME ========= “your jdk installation directory” such as “C:Program FilesJavajdk1.8.0_121”
Path ========= “%JAVA_HOME%in;%JAVA_HOME%jrein”
CLASS_PATH ========= “%JAVA_HOME%libdt.jar;%JAVA_HOME%lib ools.jar”
2: If there is no problem with the environment variable configuration, then go to the jdk installation directory (such as C:Program FilesJavajdk1.8.0_121) and look for tools.jar under lib and rt.jar under jrelib to see if they exist, it is possible that rt.pack and tools.pack exist.
At this point, just unpack the corresponding files into rt.jar and tools.jar, and you can use the unpack200 tool inside the bin
#cd /usr/java/j2sdk1.4.2/lib
#unpack tools.pack tools.jar
#cd …/jre/lib
#…/…/unpack rt.pack rt.jar
3: There is no tools.jar under lib or rt.jar under jrelib, or there are missing files under lib or jrelib (40 files), so just copy them from elsewhere.
If you run java command after copying tools.jar or rt.jar, there may be missing files under jrelib, look carefully or just copy a whole jrelib, it can be solved.
Read More:
- [Solved] Error occurred during initialization of VM Could not reserve enough space for object heap
- [Solved] jvm 1 Error occurred during initialization of VM Could not reserve enough space for object heap
- [Solved] Error occurred during initialization of VM Could not reserve enough space for 1572864KB object heap
- How to Solve Error occurred during initialization of boot layer
- [RFID] OctaneSDKJava Eclipse Error: Error occurred during initialization of boot layer
- [Solved] JAVA Error: Error occurred during initialization of boot layer java.lang.module.FindException
- [Solved] Windows Start RocketMq Error: Unrecognized VM option ‘UseCMSCompactAtFullCollection‘
- [Solved] Initialization of anonymous inner class member variable causes java.lang.stackoverflowerror
- [Solved] Java.lang.BootstrapMethodError: call site initialization exception
- log4j:WARN Error during default initialization [How to Solve]
- [Solved] springboot Project Run Error: HikariPool-1 – Exception during pool initialization.
- C language: Implementation of dynamic array initialization, insertion, traversal, deletion and destruction
- [Solved] JAVA Error: Error:A JNI error has occurred,please check your installation and try again
- [Solved] ERROR org.apache.struts2.dispatcher.Dispatcher – Dispatcher initialization failed
- [Solved] Eclipse Error: A JNI error has occurred, please check your installation and try again
- [Solved] Error: A JNI error has occurred, please check your installation and try again Exception in thread
- Eclipse Error: Could not create the Java Virtual Machine Error:A fatal exception has occurred
- [Solved] ZK Connect Error: A JNI error has occurred, please check your installation and try again
- OTA Pack Compile Error: ExternalError: Failed to run signapk.jar: return code 1:Error: A JNI error has occurred
- The error occurred while processing mapper_resultMap [How to Solve]