Error occurred during initialization of VM java/lang/ClassNotFoundException: error in opening JAR file /usr/local/java/jre/lib/rt.jar

Just a little Google fodder. Should you encounter this uncommon error message when trying to compile or run a Java program:

$ javac -version
Error occurred during initialization of VM
java/lang/ClassNotFoundException: error in opening JAR file /usr/local/java/jre/lib/rt.jar

it means that your installation of the JDK, and likely your original download is corrupt. Delete it, download again, and reinstall. This can occur with essentially any Java program: the interpreter, the compiler, jar, or a program merely written in Java such as LimeWire.

For reasons that aren’t especially clear, this bug seems to occur most frequently on Ubuntu Linux 7.10 Gutsy Gibbon when running in a virtualized environment such as VMWare. At least those seem to be the common factors for everyone else I found with this problem when googling it myself.

4 Responses to “Error occurred during initialization of VM java/lang/ClassNotFoundException: error in opening JAR file /usr/local/java/jre/lib/rt.jar”

  1. Shantha Says:

    You are absolutely right.. am using a virtual operating system(User mode Linux). am getting the error
    error occurred during initialization of VM java/lang/classNotFoundException:.. i donno how to rectify this error.. i have tried many source files to install java.. pls help me

  2. Lee Reynolds Says:

    I’ve had this problem myself on a single system running RHEL-4.

    I tried installing the RPM version of 1.6.0 update 6 AND the RPM version of 1.6.0 update 5, both gave the error above.

    The system had been running the RPM for 1.5.x and was working.

    I beat on it trying all sorts of things, removing and reinstalling the packages, downloading them again, and reinstalling, all to no avail.

    The final solution was to download the .tar.gz version and install that instead.

    I do not know why this worked while the RPM version failed.

  3. krishna Says:

    Thanks … for this

  4. Peruibeloko Says:

    i reinstalled the JDK but the error still isnt solved

Leave a Reply