Posts Tagged ‘Classloader’

Java Virtual Machine:

Main purpose : To run the compiled Java code across different network with out any modification.

Jvm doesn’t know abt Java language, it accepts only particular format (.class).A class file contains Java virtual machine instructions (bytecode) and a symbol table¬† as well as ancillary information.It can also be used to run other languages other than java.For example , Ada source code can be compiled to java bytecode and it can be executed by JVM.JVM executes .class files ,by using interpreter to emulate the instruction set or by using Just-in-Time compiler(JIT). JIT will not interpret and its used in most JVM to achieve greater speed.

JIT will convert bytecode into native machine code , thus it will improve the performance as well as it will caches the results of translating blocks (so it avoid reevaluating each line or operand each time it is met)..

How JVM Works :
-> Class will be loaded using ClassLoader(it will find the binary representation of classes).. (more…)

Read Full Post »


ClassLoader is responsible for finding and loading class file at run time.ClassLoader class is located in java.lang package.we can subclass it to our functionality for class loading

Whenever a new JVM is started ,
> Bootstrap class loader is responsible for loading java classes like java.lang.Object and other runtime code into memory first.Runtime classes are in rt.jar file
>next comes java extension class loader(path java.ext.dirsExtClassLoader).
here we can place our .jar files since it will be loaded automatically when jvm starts
>lastly ,AppClassLoader which will load classes kept in the java.class.path System property


Read Full Post »