What is the JAVA Technology?

The Java technology is:
  1. A programming language
    • You can create any kind of application that you could create by using any programming language. 
  2. A development environment
    • As a development environment Java technology provides you with a large suite of tools: a compiler, an interpreter, a documentation generator, a class file packaging tool and so on.
    • In context to web browser that is capable of running Java programs using Applets. Applets are programs written in the Java programming language that reside on web servers, are downloaded by a browser to a client's system, and are run by that browser. Applets are usually small in size to minimize download time and are invoked by a HTML web page. 
  3. An application environment
    • Java applications are standalone programs which do not require a web browser to execute. Typically, they are general-purpose programs that run on any machine where the JRE is installed.
  4. A deployment environment
    • JRE - Which include all class java technology packages i.e language classes, GUI component classes, and advanced Collection API and so on.
    • Web browser - Provide java interpreter and runtime environment.

Primary Goal of the Java Technology

  1. The JVM 
    • JVM stands for Java Virtual Machine
    • It provides hardware platform specification to which you compile all Java technology code
    • This specification enables java software to be platform independent because compilation is done for a generic machine i.e JVM
    • Compiler takes Java application source code and generate bytecodes. Bytecode are machine code instructions for JVM.
    • The JVM specification provides concrete definitions for the implementation of the following
      • Instruction set(equivalent to that of a CPU)
      • Register set
      • the class file format
      • a runtime stack
      • a garbage collected heap
      • a memory area
      • fatal error
      • reporting mechanism
      • high precision timing support
  2. Garbage collection
    • The Java programming language removes you from the responsibility of de-allocating memory. It provides a system-level thread that tracks each memory allocation. During idle cycles in the JVM, the garbage collection thread checks for and frees any memory that can be freed.
    • Garbage collection happens automatically during the lifetime of a Java technology program, eliminating the need to deallocate memory and avoiding memory leaks. However, garbage collection schemes can vary dramatically across JVM implementations.  
  3. The JRE
    • Java software source files are compiled in the sense that they are converted into a set of bytecodes from the text format in which you write them. The bytecodes are stored in .class files. 
    • At runtime, the bytecodes that make up a Java software program are loaded, checked and run in an interpreter. In the case of applets, you can download the bytecodes, and then they are interpreted by the JVM built into the browser. The interpreter has two functions
      • It executes bytecodes 
      • It makes the appropriate calls to the underlying hardware. 
    • In some Java technology runtime environments, a portion of the verified bytecode is compiled to native machine code and executed directly on the hardware platform. This enables the Java software code to run close to the speed of C or C++ with a small delay at load time to enable the code to be compiled to the native machine code. 
  4. JVM tool interface
    • The following section provides a more comprehensive discussion of the three main tasks performed by the JVM
      • Loads code - Preformed by the class loader
      • Verifies code - Performed by the bytecode verifier
      • Executes code - Performed by the runtime interpreter 
    • Class Loader
      • The class loader loads all classes needed for the execution of a program. 
      • The class loader adds security by separating the namespaces for the classes of the loacl file system from imported from network sources.The limits any Trojan Horse applications, because local classes are always loaded first.
      • After all the classes have been loaded, the memory layout of the executable file is determined. At this point, specific memory addresses are assigned to symbolic references and the lookup table is created. Because memory layout occurs at runtime, the Java technology interpreter adds protections against unauthorized access into the restricted areas of code.
    • Bytecode Verifier
      • Java software code passes several tests before running on your machine,
      • The JVM puts the code through a bytecode verifier that tests the format of code fragments and checks code fragments for illegal code, which is code that forges pointers, violates access rights on objects, or attempts to change object type.
    • Verification Process
      • The bytecode verifier makes four passes on the code in a program. It ensures that the code adheres to the JVM specifications and does not violate system integrity. If the verifier completes all four passes without returning an error message then the following is ensured. 
        • The classes adhere to the class file format of the JVM specification
        • There are no access restriction violations
        • The code cause no operand stack overflows or underflows.
        • The types of parameters for all operational codes are correct
        • No illegal data conversions, such as converting integers to object references, have occurred. 

Post a Comment

0 Comments