Java Programming Environment



  • The Java environment includes a number of development tools for classes and methods.

  • The development tools are part of the system known as Java development kit (JDK) and the classes, methods are part of the Java standard library (JSL) also known as the application programming interface API.

How Java Program Compile ?

First of all we discuss how Java program compile

  • If you learn another programming languages like C or C++ before java then you see the compiler of C and C++ compiles a source code into executable format.

  • But in java there is a some another different concept.Because java is two stage language it means java used compiler as well as interpreter to run java program. The following figure shows compilation of java program.

  • In java first source code is compiled by compiler and if there is no error in source code then the source cod is converted into JVM code that is byte code.
  • In above figure (Car.java) is a source code file and this file is compiles by compiler and then converted into (Car.class) byte code file.
  • Remember that the byte code file is only read by the java virtual machine (JVM). 

Byte Code: 

  • The Java language is used bytecode. the byte code is a special type of code that runs only on the JVM.

  •  The byte code is generated after compilation of the program by the Java compiler.

  •  A bytecode is a  machine independent code.So it can be executed on any machine means you have created this bytecode on Windows operating system then it can be executed on Linux operating system .

How Java Program Execute ?

  • The JVM code i.e bytecode is not machine readable code. So the machine readable code is generated by the java Interpreter.
  • The interpreter act's  a intermediate role between virtual machine(JVM) and real machine.
  • The following figure shows byte code conversion into machine code conversion.    
  • In the above figure the bytecode is read by the java interpreter and the java interpreter translate/ converts bytecode into machine code.
  • Remember that the interpreter is different for different Operating System.

What is Java Virtual Machine(JVM) and How it Works ?

  • We know that all the programming languages like C and C++ compiler translate source code into machine code. 

  • Java compiler also perform the same function but the only difference between another compiler and java compiler is that java compiler produce intermediate code i.e bytecode for the machine which does’t exist means compiler produce byte code only for virtual machine which only exist in computer memory.(virtual Machine is not a real machine. Real machine means operating systems of particular computer where the java program will run after compilation.)

  • How JVM Works: First of all JVM loads the (.class) file i.e bytecode code file then JVM reads the  bytecode file and translates it into machine code then this machine code executed by the particular operating system which is you used.


Java Development Tools


 Tool        Description
 javac           It is a java compiler which convert java source code into   bytecode.  
 java             It is a java interpreter which translate bytecode into machine   code.
 javadoc       It crates HTML formatted documentation from java source code   files.
 jdb               It is a java debugger which debug the program and helps to find   error.   
     appletviwer                                             It enables us to run java applets. Basically applets are the   program which run   on browser.

So if you enjoy our contain please share this notes in your friend circle. If you have any doubt or question please write it in comment section.

Thank You For Visiting !