Skip to main content



Understand ClassLoader -- Introduction

(Apparently, I'm not a native English speaker. So feel free to figure out any grammar errors or typos. I'll be very appreciated.☺)
Almost every Java programmer has came across the following two Exceptions, ClassNotFoundException and ClassCastException. When the program you written shutdown or misbehaved because of them, don’t be panic. There is no magic inside JVM. This is just a reminder that you need to learn something new. After reading this post, you will understand where these exceptions come from and how to play with them :) What is ClassLoader We know that a Java program is compiled into byte code which is loaded and executed inside JVM. Byte code is nothing but some JVM understandable commands. You can decompress a jar file and read the byte code directly in the resulting class files. You may wonder that how JVM loads these classes.

When a Java software is started, no matter it’s a GUI program or an enterprise program such as Tomcat server, an instance of JVM is creat…

Latest Posts