• Post Reply Bookmark Topic Watch Topic
  • New Topic

How does JDK work?  RSS feed

 
manju shankar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have been working on java from 2 and half years but i always had a doubt how the java compiler comiles the java code? Using which language java is written ? if it is written in C language then in which language C is written?

where can i get the byte level information(how the java compiles n runs in byte level ). I would be grateful if anyone can clear my doubts and suggest me any Links or books where i can get the information.


Thanks,
Manju
 
chetan dhumane
Ranch Hand
Posts: 643
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am also interested for answers of this question.
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
manju shankar wrote:I have been working on java from 2 and half years but i always had a doubt how the java compiler comiles the java code? Using which language java is written ? if it is written in C language then in which language C is written?

In the end, assembly language is created. This is code that can be understood and executed by the processor itself. There is one layer in between that is operating system specific, and is the cause Linux programs can't run in Windows and vice versa.

Now I see the next question coming up: in which language is the processor code executed. In the end that's going into electric circuits; AND, OR, NAND ports and other hardware.
 
manju shankar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob for the little info. Could you please suggest any Resources for reference
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about this?
 
Rob Spoor
Sheriff
Posts: 21131
87
Chrome Eclipse IDE Java Windows
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
manju shankar wrote:Using which language java is written ? if it is written in C language then in which language C is written?

The current Java compiler is written in Java.

This is how compilers are often written: when you start from scratch, you'd have to write something in machine language, manually coding the bits that make up a program, for example a simple compiler. Then you write a more sophisticated compiler in a higher-level language that you compile with the simple compiler. If your more sophisticated compiler works well, it can eventually compile its own source code. This is called bootstrapping.
 
manju shankar
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for the useful resources
 
Pankaj Upadhyay
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java compiler compiles java code and convert it to some machine language which is only understood by java interpreter. This language is known as 'byte code'. Now this is why java called platform independent because this interpreter can be different for different OS. This interpreter reads the special assembly instructions written in byte code and converts into assembly language understood by the lying OS which exactly runs your program..

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!