Aim: Study of Java run time environment (JRE)
Theory: Java is a programming language and a platform. Platform Any hardware or software environment in which a program runs, known as a platform. Since Java has its own Runtime Environment (JRE) and API, it is called platform.
The history of Java is a fascinating journey that began in the early 1990s and continues to shape the modern software development landscape. Here's an overview of the key milestones and events in the history of Java:
- Origins (Early 1990s): Java's story begins with a team of engineers at Sun Microsystems, led by James Gosling, Mike Sheridan, and Patrick Naughton. Their goal was to create a programming language that could be used to develop software for consumer electronic devices, such as set-top boxes and interactive television.
- Green Project (1991): The project, initially known as the "Green Project," aimed to develop a language that could address the challenges of programming in the rapidly evolving digital landscape. The team's efforts were focused on creating a language that was platform-independent, secure, and easy to use.
- Birth of Java (1995): In 1995, Sun Microsystems officially unveiled Java to the world. The language was positioned as a versatile, platform-independent solution for building applications that could run on any device with a Java Virtual Machine (JVM). The release of Java 1.0 marked the beginning of a new era in software development.
- Applet Revolution (Mid-1990s): Java gained widespread attention with the introduction of Java applets, which allowed developers to embed interactive content within web pages. Applets promised to revolutionize the way people interacted with the web, offering dynamic and engaging user experiences.
- Java 2 Platform (1998): Sun Microsystems released the Java 2 Platform, Standard Edition (J2SE), which introduced significant enhancements and updates to the language and its libraries. Java 2 provided a more robust and feature-rich development environment, laying the groundwork for future innovations.
- Enterprise Java (Late 1990s - Early 2000s): Java's popularity continued to grow, particularly in enterprise environments. Technologies like Enterprise JavaBeans (EJB) and JavaServer Pages (JSP) emerged, enabling the development of scalable, distributed, and web-based applications.
- Open Sourcing (2006): In a landmark move, Sun Microsystems open-sourced the Java platform under the GNU General Public License (GPL). This decision paved the way for broader adoption of Java and fostered a vibrant ecosystem of developers, contributors, and communities.
- Oracle Acquisition (2010): Oracle Corporation acquired Sun Microsystems, becoming the steward of the Java platform. The acquisition raised questions about the future direction of Java and its governance, sparking discussions within the Java community.
- Java SE Releases: Over the years, Java has seen numerous releases, each introducing new features, enhancements, and improvements. From Java SE 6 to the latest Java SE 17, the platform has evolved to meet the changing needs of developers and users alike.
- Modern Java Ecosystem: Today, Java remains one of the most widely used and influential programming languages in the world. It powers a vast array of applications, from enterprise software and web services to mobile apps and cloud-native solutions. The Java ecosystem continues to thrive, driven by a passionate community of developers and organizations committed to its success.
· Types of Java Applications
Java applications can be classified into several types based on their intended use and deployment environment. Here are the main types of Java applications:
- Standalone Applications (Desktop Applications): Standalone applications, also known as desktop applications or window-based applications, are programs that run locally on a user's computer. They typically have a graphical user interface (GUI) and provide functionality such as word processing, spreadsheet manipulation, media playback, and more. Standalone Java applications are developed using libraries like AWT (Abstract Window Toolkit) or Swing.
- Web Applications: Web applications are software applications that run on web servers and are accessed by users over the internet through web browsers. Java is widely used for building web applications due to its robustness, security features, and scalability. Technologies like Servlets, JSP (JavaServer Pages), JSF (JavaServer Faces), and Spring MVC are commonly used for developing Java-based web applications.
- Enterprise Applications: Enterprise applications are large-scale, distributed software systems used by organizations to automate business processes and operations. Java is a popular choice for building enterprise applications because of its platform independence, strong support for distributed computing, and extensive ecosystem of frameworks and libraries. Technologies like EJB (Enterprise JavaBeans), Spring Framework, Hibernate, and JPA (Java Persistence API) are commonly used in Java enterprise development.
- Mobile Applications: Mobile applications, also known as mobile apps, are software applications designed to run on mobile devices such as smartphones and tablets. Java is used for developing mobile applications primarily for the Android platform. Android development is done using the Android SDK (Software Development Kit), which includes the Java programming language, along with additional libraries and tools specific to Android app development.
- Embedded Applications: Embedded applications are software applications that are embedded within hardware devices and perform specific functions. Java is used in embedded systems development due to its portability, reliability, and security features. Embedded Java applications can be found in a wide range of devices, including set-top boxes, smart cards, industrial automation systems, and more.
- Scientific and Research Applications: Java is also used in scientific and research applications for its versatility, performance, and support for numerical computing. Java libraries such as Apache Commons Math, JScience, and Weka provide tools and algorithms for scientific computing, data analysis, machine learning, and other research-oriented tasks.
· Java Version History
- JDK Alpha and Beta (1995)
- JDK 1.0 (23rd Jan, 1996)
- JDK 1.1 (19th Feb, 1997)
- J2SE 1.2 (8th Dec, 1998)
- J2SE 1.3 (8th May, 2000)
- J2SE 1.4 (6th Feb, 2002)
- J2SE 5.0 (30th Sep, 2004)
- Java SE 6 (11th Dec, 2006)
- Java SE 7 (28th July, 2011)
- Java SE 8 LTS
(18th March, 2014)
- Java SE 9 (21st
Sep, 2017)
- Java SE 10 (20th
March, 2018)
- Java SE 11 LTS
(25th Sep, 2018)
- Java SE 12 (19th
March, 2019)
- Java SE 13 (17th
Sep, 2019)
- Java SE 14 (17th
March, 2020)
- Java SE 15 (15th
Sep, 2020)
- Java SE 16 (16th
March, 2021)
- Java SE 17 LTS
(14th Sep, 2021)
- Java SE 18 (22nd
March 2022)
- Java SE 19 (20th
September 2022)
- Java SE 20 (21st
March 2023)
- Java SE 21 LTS
(19th September 2023)
· Applications of Java:
- Web Development
- Enterprise Software Development
- Mobile App Development
- Desktop GUI Applications
- Embedded Systems
- Big Data and Analytics
- Scientific Computing
- Financial Services
- Gaming
- Educational Software
· Features of Java:
- Simple
- Object-Oriented
- Platform independent
- Secure
- Robust
- Architecture neutral
- Portable
- Dynamic
- Interpreted
- High Performance
- Multithreaded
- Distributed
· Java Programming Environment and the Java Runtime
Environment (JRE)
The Java programming environment encompasses:
- Programming Language: Java provides a robust, object-oriented programming language with features inherited from languages like C++ but with enhancements and simplifications.
- API Specification: Java offers a comprehensive set of APIs (Application Programming Interfaces) covering a wide range of functionalities, allowing developers to build various types of applications.
- Virtual Machine Specification: The Java Virtual Machine (JVM) specification defines an abstract computing machine that enables Java programs to run on any platform.
- Object-Oriented: Java follows an object-oriented programming paradigm, allowing developers to model real-world entities as objects and organize code into classes and objects.
- Architecture Neutral: Java source code is compiled into architecture-independent bytecode, which can run on any platform with a compatible JVM.
- Portable: Java's bytecode can be executed on any platform with a JVM, making Java applications highly portable across different operating systems and hardware architectures.
- Secure: Java incorporates various security features such as bytecode verification, sandboxing, and access control mechanisms to ensure the safety of executing code.
- Robust: Java's strong memory management, exception handling, and type safety mechanisms contribute to its robustness, reducing the likelihood of runtime errors and crashes.
- High Performance: Java offers high-performance execution through features like Just-In-Time (JIT) compilation, which dynamically translates bytecode into native machine code for efficient execution.
- Multithreaded: Java provides built-in support for multithreading, allowing concurrent execution of multiple threads within a single Java application.
- Distributed: Java facilitates the development of distributed applications with extensive networking capabilities and support for technologies like Remote Method Invocation (RMI) and Java Remote Method Protocol (JRMP).
Java Runtime Environment (JRE):
What is JRE?
Java Run-time Environment (JRE) is
the part of the Java Development Kit (JDK). 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. If
you wish to run this bytecode on any platform, you 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.
It also includes:
- Technologies which get used for deployment
such as Java Web Start.
- Toolkits for user interface like Java 2D.
- Integration libraries like Java
Database Connectivity (JDBC) and Java Naming and
Directory Interface (JNDI).
- Libraries such as Lang and util.
- Other base libraries like Java
Management Extensions (JMX), Java Native Interface (JNI) and
Java for XML Processing (JAX-WS).
What does JRE consist of?
JRE consists of the following
components:
- Deployment technologies such as deployment,
Java plug-in, and Java Web Start.
- User interface toolkits, including Abstract Window
Toolkit (AWT), Swing, Java 2D, Accessibility, Image I/O, Print Service,
Sound, drag, and drop (DnD) and input methods.
- Integration libraries including Interface
Definition Language (IDL), Java Database Connectivity (JDBC), Java Naming
and Directory Interface (JNDI), Remote Method Invocation (RMI), Remote
Method Invocation Over Internet Inter-Orb Protocol (RMI-IIOP) and
scripting.
- Other base libraries, including international
support, input/output (I/O), extension mechanism, Beans, Java Management
Extensions (JMX), Java Native Interface (JNI), Math, Networking, Override
Mechanism, Security, Serialization and Java for XML Processing (XML JAXP).
- Lang and util base libraries, including lang and util,
zip, Java Archive (JAR), instrument, reflection, Collections, Concurrency
Utilities, management, versioning, Logging, Preferences API, Ref Objects
and Regular Expressions.
- Java Virtual Machine (JVM), which comprise of Server
Virtual Machine and Java HotSpot Client.
How does JRE work with JVM?
JRE has an instance of JVM with it,
library classes and development tools. To understand the working of JRE let us
see an example of a simple "Hello World" program.
Once you write this program, you have
to save it with .java extension. Compile your program. The output of the Java
compiler is a byte-code which is platform independent. After compiling, the
compiler generates a .class file which has the bytecode. The bytecode is
platform independent and runs on any device having the JRE. From here, the work
of JRE begins. To run any Java program, you need JRE. The flow of the bytecode
to run is as follows:
The following steps take place at
runtime:
- Class LoaderAt this step, the class loader loads various classes which are essential for running the program. The class loader dynamically loads the classes in the Java Virtual Machine.When the JVM is started, three class loaders are used:
- Bootstrap class loader
- Extensions class loader
- System class loader
- Byte code verifierByte code verifier can be considered as a gatekeeper. It verifies the bytecode so that the code doesn't make any sort of disturbance for the interpreter. The code is allowed to be interpreted only when it passes the tests of the Bytecode verifier which checks the format and checks for illegal code.
- InterpreterOnce the classes get loaded and the code gets verified, then interpreter reads the assembly code line by line and does the following two functions:
- Execute the Byte Code
- Make appropriate calls to the underlying
hardware
In this way, the program runs in JRE.
Additional oral questions:
- What is the Java programming environment?
- Describe the key components of the Java Runtime Environment (JRE).
- What is the Java Virtual Machine (JVM), and what role does it play in the Java ecosystem?
- How does Java achieve platform independence?
- Explain the concept of bytecode and its significance in Java.
- What are the main characteristics of the Java programming language?
- Discuss the role of class libraries in the Java Runtime Environment.
- Describe the process of compiling and executing a Java program.
- Explain the difference between the Java Development Kit (JDK) and the Java Runtime Environment (JRE).
- Discuss the significance of the Java platform in modern software development.
Hi sir
ReplyDelete