JRE 1.7 - java version - returns: java/lang/NoClassDefFoundError: java/lang/Object

Viewed 252716

When running any java application, or just 'java', the jvm fails:

Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object

Here is a list of wrong answers:

  1. The correct Java home directory, including the /bin directory, is on the global PATH

  2. JAVA_HOME is set correctly

  3. Executing the command java -fullversion works

    $ java -fullversion
    
    ./java full version "1.7.0_05-b05"
    
  4. The symbolic links in /usr/java all point to the correct java installation

  5. I did not install any 'default' java when I created the system

  6. java -version fails...same error as above

  7. Issuing the commands from under the directory structure of the java installation does not work either

  8. This is 64-bit java for a 64-bit

Any ideas?

28 Answers

Go to control panel, uninstall the java related stuff(close eclipse if opened), then re-install java and open eclipse, clean projects.

So, I went on trying everything and at last it seems that reinstalling java after uninstalling it fixed my problem.

if any problem for JAVA installation version

C:\Where JAVA

will give the location of java it picking up. If you have any path other than your installation, remove those files or rename it (may be as _backup). you will get proper version of java file.

I had the same issue in Redhat Linux 7. This has been resolved by removing, installing the following RPMs and reload the terminal.

java-1.8.0-openjdk-1.8.0.232.b09-0.el7_7.x86_64 
java-1.8.0-openjdk-devel-1.8.0.232.b09-0.el7_7.x86_64
java-1.8.0-openjdk-headless-1.8.0.232.b09-0.el7_7.x86_64

Related