Java.Lang.Noclassdeffounderror: Could Not Initialize Class Xxx

java.lang.NoClassDefFoundError: Could not initialize class XXX

My best bet is there is an issue here:

static {
//code for loading properties from file
}

It would appear some uncaught exception occurred and propagated up to the actual ClassLoader attempting to load the class. We would need a stacktrace to confirm this though.

Either that or it occurred when creating PropHolder.prop static variable.

Exception in thread main java.lang.NoClassDefFoundError: Could not initialize class sun.util.calendar.ZoneInfoFile

I figured out the problem. The TimeZone dependency was missing from the OpenJDK installation: The symbolic link $JAVA_HOME/jre/lib/tzdb.dat -> /usr/share/javazi-1.8/tzdb.dat was pointing to an empty directory. I downloaded the rpm file tzdata-java-2021c-1.el8.noarch.rpm and installed using the command:
rpm -ivh tzdata-java-2021c-1.el8.noarch.rpm

All works fine now.



Related Topics



Leave a reply



Submit