How to Fix Error Occurred During Initialization of VM Java/Lang/Noclassdeffounderror: Java/Lang/Object

Sheeraz Gul Feb 02, 2024
How to Fix Error Occurred During Initialization of VM Java/Lang/Noclassdeffounderror: Java/Lang/Object

This tutorial demonstrates the Error occurred during initialization of VM java/lang/noclassdeffounderror: java/lang/object error in Java.

Error Occurred During Initialization of VM java/lang/noclassdeffounderror: java/lang/object

The Error occurred during initialization of VM java/lang/noclassdeffounderror: java/lang/object occurs when systems get confused when running Java. This occurs when we run Java as an environment variable, but running Java from its directory will work properly.

Whenever Error occurred during initialization of VM java/lang/noclassdeffounderror: java/lang/object occurs, Java is installed properly, and the correct path is set for the environment variables.

The reasons for this error are ambiguous, but some solutions can be applied in different scenarios. The reasons include:

  1. When we updated the Java Development Kit (JDK) but forgot to update the Java Runtime Environment (JRE). In the recent versions, JRE is included in the JDK, so we don’t have to install it separately.
  2. When an unknown application has copied java.exe files to the Windows directory, and Windows start running Java from the Windows directory, this error will occur when the supportive files are not found.

The error looks like this when we run Java in the CMD:

Error occurred during initialization of VM
java/lang/noclassdeffounderror: java/lang/object

Running Eclipse

Usually, when this error stops Eclipse from initializing. The Eclipse problem can be solved following the steps below.

  • Go to the Eclipse directory.
  • Open the eclipse.ini file.
  • Add the following lines with your path to the ini file before the vmargs:
-vm
C:\Program Files\Java\jdk1.7.0_10\bin\javaw.exe

Save the eclipse.ini file and run Eclipse.

Check the Windows Directory

If the Error Occurred During Initialization of VM java/lang/noclassdeffounderror: java/lang/object error is occurring, then you should follow some steps to know the ambiguous reasons:

  1. Go to the Windows directory.
  2. Check if you can find the exe file from Java.
  3. These files are copied by an application on Windows.
  4. Deleting these files may solve the problem.
  5. Finding the application is not easy, but you can check all the applications running Java.
Author: Sheeraz Gul
Sheeraz Gul avatar Sheeraz Gul avatar

Sheeraz is a Doctorate fellow in Computer Science at Northwestern Polytechnical University, Xian, China. He has 7 years of Software Development experience in AI, Web, Database, and Desktop technologies. He writes tutorials in Java, PHP, Python, GoLang, R, etc., to help beginners learn the field of Computer Science.

LinkedIn Facebook

Related Article - Java JVM

Related Article - Java Error