Who owns Java? #
- 1995: Sun Microsystems created Java.
- 2009: Oracle Corporation acquired Sun Microsystems, gaining control over Java.
- Oracle continues to develop and release new Java versions.
Java SE vs Java EE vs Java ME #
π Java SE (Standard Edition)
- Core Java platform with fundamental libraries, JDK, JRE and JVM
- Core Libraries: Includes
java.lang
,java.util
,java.io
, andjava.net
- Database Connectivity: Uses JDBC for interacting with databases
- Earlier called J2SE
π Java EE (Enterprise Edition) β Now Jakarta EE
- Built on Java SE to support enterprise-grade applications
- Common Use Cases: Large-scale applications, APIs, and cloud services
- Servlets & JSP: Enables dynamic web applications
- JPA (Java Persistence API): Supports database ORM (Object-Relational Mapping)
- Web Services: Provides REST (JAX-RS) and SOAP (JAX-WS) support
- Renamed: J2EE > Java EE > Jakarta EE
- Java EE (Enterprise Edition) was rebranded as Jakarta EE after being transferred from Oracle to the Eclipse Foundation in 2017
π Java ME (Micro Edition)
- Lightweight Java version for mobile, embedded systems, and IoT devices
- Optimized for Low-Memory Devices: Used in feature phones, smart cards etc.
- Limited API Support: Subset of Java SE, designed for resource-constrained environments
How has Java evolved over the last few decades? #
π Embedded Systems (1990s)
- Early Purpose: Developed as a platform-independent language for embedded systems
- Oak to Java: Originally designed for interactive televisions, rebranded as Java in 1995 for general computing
π Web Applications (Early 2000s)
- Adoption in Web Development: Became widely used with Java EE (now Jakarta EE)
- Dynamic Web Pages: Servlets and JSP enabled interactive and data-driven web applications
- Framework Evolution: Spring and Hibernate simplified development and improved scalability
π Mobile Development (Mid-2000s)
- Java in Mobile: Became the dominant language for mobile applications
- Android Boom: In 2008, Google adopted Java as the primary Android language
- Rise of Kotlin: Introduced in 2017 as an official Android language, but Java remains widely used
π Microservices & Cloud (2010sβPresent)
- Shift to Cloud-Native: Java adapted to cloud-based and microservices architectures
- Spring Boot Revolution: Improved modularity and scalability for microservices
- Containerization: Java applications now run efficiently on Docker, Kubernetes, and cloud platforms
What is a JAR file? #
π Overview
- What?: Single package containing
.class
files, images, configuration files, and libraries in one archive. - Why?: Makes Java applications easy to package, distribute, and run
π Why Use JAR Files?
Feature | Why It Matters? |
---|---|
Easy Distribution | Packages all dependencies into one file. |
Compression | Reduces storage and transfer size. |
Executable | Allows running Java applications with java -jar . |
Create Sharable Libraries | Used for sharing Java libraries (e.g., mysql-connector.jar ). |
π Creating and running a JAR file
jar cf MyApp.jar *.class #Create a JAR File
java -jar MyApp.jar #Run it (Needs `MANIFEST.MF`)
π Manifest File for an Executable JAR: META-INF/MANIFEST.MF
Main-Class: com.example.MainApp
Oracle JDK vs Amazon Corretto vs OpenJDK vs GraalVM #
π OpenJDK
- Purpose: Open-source reference implementation of Java
- Maintenance: Managed by the Java community and major vendors (IBM, Apple..)
- Support: Regular updates but no built-in commercial support
- Best For: Developers and organizations preferring open-source solutions
π Oracle JDK
- Purpose: Official Java distribution from Oracle
- Features: Premium support and security updates
- Best For: Enterprises needing long-term support
π Amazon Corretto
- Purpose: Free, OpenJDK-based distribution from Amazon
- Optimization: Designed for AWS and cloud environments
- Support: Includes long-term support and performance enhancements
- Best For: Businesses on AWS seeking cost-effective Java solutions
π GraalVM
- Purpose: An advanced JDK with ahead-of-time (AOT) Native Image compilation
- Low Resource Usage: Native executables use only a fraction of memory and CPU resources required by a JVM, which improves utilization and reduces costs.
- Fast Startup: Requires no warmup to run at peak performance
- Compact Packaging: Native executables are small and easy to deploy in minimal container images
- Support:
- Community Edition β Free, open-source, maintained by Oracle
- Enterprise Edition β Paid support with advanced optimizations and security updates from Oracle
- Best For:
- Microservices and serverless computing where fast startup time is critical
- Cloud-native applications with low memory footprint
What is JCP? #
JCP ensures Java evolves through an open, community-driven process, with JSRs defining major new features.
- JCP (Java Community Process)
- Definition: The official process for defining and evolving Java standards
- Participants: Oracle, corporations, developers, and Java experts
- How It Works
- Proposals: New Java platform features are proposed as JSRs (Java Specification Requests)
- Review & Voting: The Executive Committee reviews, provides feedback, and votes
- Reference Implementation: A working implementation is developed and tested
- Example: JSR 330 (Dependency Injection for Java)
- Purpose: Standardized annotations like
@Inject
for dependency injection - Approval: Passed through the JCP and became part of Java EE 6
- Impact: Unified dependency injection across different frameworks like Spring and Jakarta EE
- Purpose: Standardized annotations like
JSR vs JEP #
JEPs handle JDK enhancements, while JSRs define major Java standards that require JCP approval.
π JEP (JDK Enhancement Proposal)
- Purpose: Proposes and tracks changes to the JDK (Java Development Kit)
- Scope: Used for incremental improvements, like language enhancements and performance optimizations
- Process: Proposed by developers, reviewed internally by the OpenJDK team
- Approval: Requires review but does not need JCP approval
- Example:
- JEP 378: Text Blocks
- JEP 359: Records
- JEP 436: Virtual Threads (Project Loom)
π JSR (Java Specification Request)
- Purpose: Defines new Java standards, including APIs, libraries, and frameworks
- Scope: Used for major changes that require community consensus, such as Java EE (Jakarta EE) specifications
- Process: Goes through the JCP (Java Community Process) for approval
- Approval: Voted on by the JCP Executive Committee
- Example:
- JSR 330: Standardized Dependency Injection annotations (
@Inject
) - JSR 370: JAX-RS 2.1 (RESTful Web Services)
- JSR 330: Standardized Dependency Injection annotations (
Java Release Numbering #
Currently - a sequential numbering system like Java 8, Java 9, Java 10,..., Java 21,.., Java 27, ...
Did Java Release Numbering follow a different standard earlier? #
π Pre-2017 Versioning (Major.Minor Format)
- Java versions followed a Major.Minor format, such as Java 1.2, Java 1.4, Java 1.5.
- Confusing Naming: Java 1.5 was also called Java 5, creating inconsistency.
π Post-2017 Versioning (Simplified Integer Format)
- Format Change: Versioning switched to a simple integer format (Java 9, Java 10, Java 11, etc.).
π Why the Change?
- Simplifies Naming: No more confusion between "Java 1.8" and "Java 8"βjust Java 8, Java 9, Java 10, etc.
When are new Java versions released? #
π Pre-2017 Release Schedule
- Irregular Releases: Java versions were released every few years, with long gaps between major versions
- Notable Versions: Java 5 (2004), Java 6 (2006), Java 7 (2011), Java 8 (2014)
- Unpredictable Upgrades: Developers had to wait several years for new features and improvements
π Post-2017 Release Schedule
- Six-Month Cycle: Starting with Java 9 (2017), new versions were released every six months (March & September).
- Predictable Updates: Developers now get regular feature releases without long delays.
- LTS Every Two (or Three) Years: Java 11 (2018), Java 17 (2021), Java 21 (2023), Java 25 (2025)
π Why the Change?
- Faster Innovation: Shorter cycles allow Java to keep up with modern programming needs.
- Less Migration Pain: Regular, incremental updates reduce the burden of upgrading from older versions.
- Clear Roadmap: Developers and businesses can plan ahead for new features and LTS versions.
Long-Term Support (LTS) vs Non-LTS Releases #
π Long-Term Support (LTS) Releases
- Definition: LTS versions receive extended security updates and commercial support for a number of years
- Major LTS Versions: Java 8 (2014), Java 11 (2018), Java 17 (2021), Java 21 (2023), Java 25 (2025), ....
- Support Duration: Oracle and other vendors provide LTS support for at least 8 years.
- Best For: Enterprises and production environments needing stability and long-term maintenance.
π Non-LTS Releases
- Definition: Short-term versions released every six months with new features.
- Examples: Java 22, 23, 24, 26, 27, ....
- Support Duration: Typically six months, until the next feature release.
- Best For: Developers who want early access to new features.
Why Java is Still Popular? #
Java remains a top choice because it is stable, scalable, secure, and works everywhereβmaking it ideal for enterprise, web, and cloud applications.
Feature | Why It Matters? | Example |
---|---|---|
Platform Independence | No OS-specific code needed | JVM executes bytecode everywhere |
Strong Ecosystem | Frameworks for every use case | Spring Boot, Hibernate, Android SDK |
Performance | Faster than most interpreted languages | Used in Big Data (Hadoop, Kafka) |
Memory Management | No manual malloc/free |
Garbage Collector handles memory |
Security | No direct memory access, strong encryption | Used in banking and fintech apps |
Community Support | Millions of developers and active support | Stack Overflow, GitHub |
Scalability | Powers large-scale cloud apps | Netflix, Amazon use Java microservices |
Backward Compatibility | Avoids costly rewrites | Java 8 apps still work in Java 17 |