An overview of the software development process



In the Java programming language, all source code is first written in plain text files ending with the .java extension. Those source files are then compiled into .class files by java compiler, using the below command or java tool:
      “Javac MyProgram.java”

A .class file does not contain code that is native to your processor; it instead contains bytecodes. Bytecode is the intermediate representation of Java programs just as assembler is the intermediate representation of C or C++ programs; it is also represented as the machine language of the Java Virtual Machine (Java VM).





The java launcher tool then runs your program with an instance of the Java Virtual Machine. Java Virtual Machine is responsible to convert your bytecode to machine specific code that are native to your processor. Below is the java launcher tool or command to run your program:
      “Java MyProgram”




JVM is bundled with JDK and JRE binaries, as stated in the previous section and it is responsible to convert your bytecode to machine specific code. Since the machine code would differs for each operating system we have different JDK and JRE installable for Microsoft Windows, the Solaris™ Operating System (Solaris OS), Linux, or Mac OS.

Everyone would have heard about "Write once, run anywhere" (WORA), or sometimes write once, run everywhere (WORE) terminology in java, it is a slogan created by Sun Microsystems to illustrate the cross-platform benefits of the Java language. Ideally, this means Java can be developed on any device, compiled into a standard bytecode and be expected to run on any device equipped with a Java virtual machine (JVM). Thus if the java program/.java file is compiled into bytecode/.class file it can you executed on any Operation System provided JDK or JRE or JVM is installed on that machine.

No comments :

Post a Comment