Thursday 31 August 2017

Java Jargon Explained

Cited from the Book Java How to Program

Java SE Development Kit==JDK

A file name ending with the .java extension indicates that the file contains Java source code.

Compiler creates bytecodes and stores them on disk in a file whose name ends with .class.

The Java compiler translates Java source code into bytecodes that represent the tasks to execute in the execution phase. Bytecodes are executed by the Java Virtual Machine (JVM)—a part of the JDK and the foundation of the Java platform. A virtual machine (VM) is a software application that simulates a computer but hides the underlying operating system and hardware from the programs that interact with it.

Unlike machine language, which is dependent on specific computer hardware, bytecodes are platform independent—they do not depend on a particular hardware platform. So, Java’s bytecodes are portable—without recompiling the source code, the same bytecodes can execute on any platform containing a JVM that understands the version of Java in which the bytecodes were compiled. The JVM is invoked by the java command.

The JVM’s class loader takes the .class files containing the program’s bytecodes and transfers them to primary memory. The class loader also loads any of the .class files provided by Java that your program uses.

Bytecode verifier confirms that all bytecodes are valid and do not violate Java’s security restrictions.

Today’s JVMs typically execute bytecodes using a combination of interpretation and so-called just-in-time (JIT) compilation. In this process, the JVM analyzes the bytecodes as they’re interpreted, searching for hot spots -- parts of the bytecodes that execute frequently. For these parts, a just-in-tim(JIT) compiler—known as the Java HotSpot compiler—translates the bytecodes into the underlying computer’s machine language. When the JVM encounters these compiled parts again, the faster machine-language code executes.

A Java application is a computer program that executes when you use the java command to launch the Java Virtual Machine (JVM).

No comments:

Post a Comment