The compilation to "bytecode" is done by javac, the Java compiler. garbage collection is encompassed in JRE.Just-in-time compiler which is actually the part of JVM does the real compilation part of bytecode to machine code, plus caching byte codes if necessary. JVM(which by itself is platform dependent) executes the bytecode to machine code. JRE contains JVM and other libraries to create runtime environment. Q2: Javac must be a part of JDK and NOT JRE? Q1: Now this compilation to byte code, is this really a compilation or is it interpreted? Now I can take this bytecode generated in Mac and go to windows machine and run it which should work fine. That is it gives a class file which is byte code. Javac HelloWowrld.java gives HelloWorld.class. Two questions marked Q1 and Q2 are below point 2. Corrections on my understanding are most welcome. So I am writing what I understand from different blogs, but some blanks do exists. I could not find a clear answer illustrating the steps from beginning to end in JRE and JDK jargon. I did some search trying to understand how the java source files are executed.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |