Class notes:
Flow of a Java code:
-> We create First.java program.
->We compile it using javac First.java.
->The compilation happen where the .java file is converted into .class file
->We will get First.class file.
->This first.class file to JRE
-> JVM is part of JRE.
->JVM takes the First.class file and converts into binary code.
JDK:
->JDK is an implementation of the Java platform specification, which includes the compiler and standard class libraries.
->The JDK is a software package has to be downloaded in order to create Java-based applications.
-> For running Java programs on your machine we can easily do it using Java Run-time Environment. For developing a Java-based software application then along with JRE we need some additional necessary tools, which is called JDK.
JVM:
->JVM is an abstract machine. It is a specification that provides run time environment in which java byte code can be executed.
->A specification where working of Java Virtual Machine is specified. But implementation provider is independent to choose the algorithm. Its implementation has been provided by Oracle and other companies.
->An implementation Its implementation is known as JRE (Java Runtime Environment).
->JVM performs the following operations lodes code, verifies code,executes code, provides run time environment.
->JVM Architecture.[TBD]
->Class loader:Class loader is a subsystem of JVM which is used to load class files. Whenever we run the java program, it is loaded first by the class loader.
JRE:
->Java Run-time Environment is the part of the Java Development Kit .
-> It is a freely available software distribution which has Java Class Library, specific tools, and a stand-alone JVM.
->It is the most common environment available on devices to run java programs.
->The source Java code gets compiled and converted to Java bytecode. To run a bytecode on any platform, we require JRE.
->The JRE loads classes, verify access to memory, and retrieves the system resources. JRE acts as a layer on the top of the operating system.
Components of JRE -TBD
- Integration libraries include Java Database Connectivity (JDBC)
- Java Naming, Interface Definition Language (IDL)
- Directory Interface (JNDI)
- Remote Method Invocation Over Internet Inter-Orb Protocol (RMI-IIOP)
- Remote Method Invocation (RMI)
- Scripting
->Once java program is written, w should save the file name with a “.java” extension. The output of the Java compiler is byte code which is a platform-independent code. After compiling, the compiler generates a .class file that contains the byte code. Bytecode is platform-independent that runs on all devices which contain Java Runtime Environment (JRE).
Reference:
https://www.geeksforgeeks.org/jdk-in-java/
https://www.javatpoint.com/jvm-java-virtual-machine
https://www.javatpoint.com/java-jre